Jump to content

adding SQL data to an PHP array


edd12345678

Recommended Posts

Hi everyone,

 

Hope someone can help. 

 

Does anyone know why this is nor displaying any data?

 

  $qry = mysql_query("select * from product");
$data = array();
while($row = mysql_fetch_array($qry)){

$productName[] =$row['productName'];     
// Item name
}

for($i=0;$i<mysql_num_rows($row);$i++)
{ 

 $data = $productName[$i];

} 
return $data;

 

Thanks in advance

 

Edd

Link to comment
https://forums.phpfreaks.com/topic/259643-adding-sql-data-to-an-php-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.