In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] ("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&nbsp;", $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&nbsp;", $myrow["equip_type"]); //no table name

or:

   extract($myrow);
   printf("%s&nbsp;", $equip_type); //no table name and easier to read ;-)

-- 
CC

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to