Jump to content

PHP MySQL select query returning duplicates in array


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>";
echo "</pre>";	


and my output looks like this:

    [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:



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.