Re: php with mysql - multiple tables
| From: | CC Zona | Date: | Mon, 16 Apr 2001 05:28:45 +0000 |
| Subject: | Re: php with mysql - multiple tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-8589@lists.php.net to get a copy of this message | ||
In article <3ADA7528.48F9485D@sains.com.my>,
shahmatd@sains.com.my ("Shahmat Dahlan") wrote:
> $result=mysql_query($sqlstmt);
>
> I know the $sqlstmt query does work. But if I do a mysql_fetch_array and
> assign it to a variable called $myrow,
>
> while ($myrow=mysql_fetch_array($result)) {
> ...
> }
>
> how do I display the content array $myrow? When I do a,
>
> printf("%s ", $myrow["equip.equip_type"]);
>
> nothing is visible.
$result=mysql_query($sqlstmt) or die("Oops! MySQL error: " .
mysql_error()); //"know" the query is valid
if(mysql_num_rows($result)) //"know" the query gave you something to fetch
{
while ($myrow=mysql_fetch_array($result))
{
...
}
}
Where "..." is:
printf("%s ", $myrow["equip_type"]); //no table name
or:
extract($myrow);
printf("%s ", $equip_type); //no table name and easier to read ;-)
--
CC