Jump to content

PHP MySQL select query returning duplicates in array


rvdb86

Recommended Posts

Hey guys,

 

I am trying to perform a very simple select query from a MySql database, but for some reason the array that is returned contains duplicates.

 

This is my code:

 

$allData = mysql_query("SELECT * FROM table");
while($result = mysql_fetch_array($allData)){
echo "<pre>";
print_r($result);
echo "</pre>";	
}

 

and my output looks like this:

Array
(
    [0] => 62
    [id] => 62
    [1] => 502fa610b7856
    [intID] => 502fa610b7856
    [2] => 4c36fd909b37208b
    [location] => 4c36fd909b37208b
    [3] => obj2
    [shoe] => obj2
    [4] => how_to_use_with_back_displayed
    [action] => how_to_use_with_back_displayed
    [5] => 2012-08-18 17:26:22
    [date] => 2012-08-18 17:26:22
    [6] => 00:00:00
    [duration] => 00:00:00
)

 

Why is it duplicating every column??  :confused:

 

TIA!

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.