Jump to content

[SOLVED] i want an array


jakatu

Recommended Posts

Cycle through the results and add to the array each time you do:

 

<?php
$sql = "SELECT field FROM table";
$result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR);
$array = array();
while($row = mysql_fetch_assoc($result)){
$array[] = $row['field'];
}
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.