|
-
Apr 25th, 2006, 03:22 PM
#1
Thread Starter
Frenzied Member
Else error :S
Big problem, the code below is returning an error (unexpected else)
I do not know what i have done wrong?
This is the page i am getting the error on :S
PHP Code:
<?php
$db = mysql_connect("***", "***", "***");
mysql_select_db("***",$db);
$result = mysql_query("SELECT * FROM meltdown_download Where category='programs'",$db);
while ($myrow = mysql_fetch_row($result)) {
$imgQuery = mysql_query("SELECT * FROM meltdown_images Where download_id='" . $myrow[0] . "' LIMIT 1",$db);
$num_rows = mysql_num_rows($imgQuery);
if (!$num_rows==0);
echo $imgQuery[1];
else
echo("<table class=\"content_main\" cellspacing=\"0\" cellpadding=\"0\" >\n");
echo(" <tr>\n");
echo(" <td class=\"content_tl\"></td>\n");
echo(" <td class=\"content_t\">" . $myrow[2] . "</td>\n");
echo(" <td class=\"content_tr\"></td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td class=\"content_stl\"></td>\n");
echo(" <td class=\"content_stm\"></td>\n");
echo(" <td class=\"content_str\"></td>\n");
echo(" </tr>\n");
echo(" <tr bgcolor=\"#FFFFFF\">\n");
echo(" <td class=\"content_l\"></td>\n");
echo(" <td class=\"content_m\">" . $myrow[3] . "</td>\n");
echo(" <td class=\"content_r\"></td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td class=\"content_sbl\"></td>\n");
echo(" <td class=\"content_sbm\"></td>\n");
echo(" <td class=\"content_sbr\"></td>\n");
echo(" </tr>\n");
echo(" <tr>\n");
echo(" <td class=\"content_bl\"></td>\n");
echo(" <td class=\"content_b\"></td>\n");
echo(" <td class=\"content_br\"></td>\n");
echo(" </tr>\n");
echo("</table>\n");
echo("<br>\n");
}
?>
-
Apr 25th, 2006, 03:32 PM
#2
Re: Else error :S
I am going to do you a favour ....
-
Apr 25th, 2006, 03:53 PM
#3
Re: Else error :S
First, take a look at this: http://www.vbforums.com/showpost.php...49&postcount=7
Now your code should be looking something like:
PHP Code:
<?php
$db = mysql_connect("***", "***", "***");
mysql_select_db("***",$db);
$result = mysql_query("SELECT * FROM meltdown_download Where category='programs'",$db);
while ($myrow = mysql_fetch_row($result)):
$imgQuery = mysql_query("SELECT * FROM meltdown_images Where download_id='" . $myrow[0] . "' LIMIT 1",$db);
$num_rows = mysql_num_rows($imgQuery);
if (!$num_rows==0):
/* to echo the first row */
echo (mysql_result($imgQuery, 0));
else: // remember PHP is embedded inside HTML
?>
<table class="content_main" cellspacing="0" cellpadding="0" >
<tr>
<td class="content_tl"></td>
<td class="content_t"><?php echo($myrow[2]) ?></td>
<td class="content_tr"></td>
</tr>
<tr>
<td class="content_stl"></td>
<td class="content_stm"></td>
<td class="content_str"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="content_l"></td>
<td class="content_m"><?php echo($myrow[3]) ?></td>
<td class="content_r"></td>
</tr>
<tr>
<td class="content_sbl"></td>
<td class="content_sbm"></td>
<td class="content_sbr"></td>
</tr>
<tr>
<td class="content_bl"></td>
<td class="content_b"></td>\
<td class="content_br"></td>
</tr>
</table> <br />
<?php
endif;
endwhile;
?>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|