RE: [PHP] Inner Join or 2nd Query...?
| From: | Carl Furst | Date: | Thu, 12 May 2005 17:02:49 +0000 |
| Subject: | RE: [PHP] Inner Join or 2nd Query...? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-215055@lists.php.net to get a copy of this message | ||
I think you need to have the result from a mysql_connect() in order for that
to work..
As in:
$myResource = mysql_connect(user, pass, host, etc....);
You just have a statement handle there. Which is good for the fetch commands
like mysql_fetch_row(), but not the num rows command.
Carl Furst
carl@vote.com
-----Original Message-----
From: Mark Sargent [mailto:powderkeg@snow.email.ne.jp]
Sent: Thursday, May 12, 2005 3:17 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Inner Join or 2nd Query...?
Hi All,
ok, this revised code produces the error below,
<?php
mysql_select_db("status",$db);
$maker_result = mysql_query("SELECT Makers.maker_id Makers.maker_detail
FROM Makers",$db);
$maker_num = mysql_num_rows($maker_result); //Line 40
?>
<select name="slct_maker">
<?php
for ($i=0; $i<$maker_num; $i++){
$maker_myrow=mysql_fetch_array($maker_result);
$maker=mysql_result($maker_result,$i,"maker_detail");
$maker_id=mysql_result($maker_result,$i,"maker_id");
echo "<option value=\"$maker_id\">$maker</option><br>";
}
?>
</select>
*Warning*: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in */var/www/html/products.php* on line *40
Cheers.
Mark Sargent.
*