I select one column from my mysql database:
$savedSQL = 'SELECT can_id FROM savedsearches WHERE user_id = "'.mysql_real_escape_string($user_id).'" AND insertTime >= "'.$lastSigTime.'"'; $savedQuery = mysql_query($savedSQL);
And I would like to return the values as a single dimension, an enumerable array, such as array [0] = row1, array [1] = row2, etc.
When I put it in an array like this:
while($savedResult = mysql_fetch_array($savedQuery)) { $savedArray[] = $savedResult; }
It returns it as a multidimensional array, so that the array [0] [0] = row1, array [1] [0] = row2, etc.
I was thinking of adding something like this:
while($i=0;$i<count($savedArray);$i++) { $newSavedArray[$i] = $savedArray[$i][0] }
But is there an easier and more efficient way to do this?
source share