Jump to content

MySQL Row To Array Syntax Question


atticus

Recommended Posts

Hi all, I want to put the data from MySQL into a regular array so that I can use array_unique to to remove duplicate data.

 

I need all three variables to be associated with one index point.

 

$months = array();
$i = 0;
while($row = mysql_fetch_array($query)) {
$monthname = $row['MONTHNAME(`time`)'];
$year = $row['YEAR(`time`)'];
$month = $row['MONTH(`time`)'];

$months[] = ($i => $monthname,$year, $month);  

$i++;

 

 

Link to comment
https://forums.phpfreaks.com/topic/205966-mysql-row-to-array-syntax-question/
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.