Kod:mysql_fetch_array(): supplied argument is not a valid MySQL result resource
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<?php
$objConn = mysql_connect(MYSQLHOST,MYSQLUSER,MYSQLPASS);
if (!$objConn) {
die('<br /><br /><b>Could not connect to server:</b><br />' . mysql_error());
}
mysql_select_db(MYSQLDB) or die('<br /><br /><b>Could not connect to database:</b><br />' . mysql_error());
$SQL = "SELECT price_head.*, price_sub_head.*, price_info.*
FROM (price_head INNER JOIN price_sub_head ON price_head.id = price_sub_head.price_id)
INNER JOIN price_info ON price_sub_head = price_info.price_head WHERE price_head.page_id = 1";
$query = mysql_query($SQL);
while($txt = mysql_fetch_array($query))
{
?>
<tr>
<td width="42%"><b><?php print $txt['price_head.price_head']; ?></b></td>
<td width="24%" align="right"> </td>
<td width="17%" align="right"><b><?php print $txt['price_head.price_low']; ?></b></td>
<td width="17%"><b><?php print $txt['price_head.price_high']; ?></b></td>
</tr>
<tr>
<td><?php print $txt['price_sub_head.price_sub_head']; ?></td>
<td align="right"> </td>
<td align="right"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td align="right"><?php print $txt['price_info.price_name']; ?></td>
<td align="right"><b><?php print $txt['price_info.price_low']; ?></td>
<td><?php print $txt['price_info.price_high']; ?></td>
</tr>
<?php
}
mysql_close($objConn);
?>
</table>
Felmeddelande:<code>Warning: mysql_fetch_array(): supplied argument is not a valid MySQ
result resource in C:\www\bcb\page\price_test.php on line 42</code>
Rad 42 är:
while($txt = mysql_fetch_array($query))