Jump to content

[SOLVED] Transferring data from a Mysql column to a php array...


captainspi

Recommended Posts

You'll want something like this:

 

$sql = "SELECT field FROM yourtable";
$result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR);
$array = array();
while($row = mysql_fetch_row($result)){
$array[] = $row[0];
}
print_r($array);

 

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.