Jump to content

double result, and i dont know why


Silverado_NL

Recommended Posts

hi everybody, im no wonder @ mysql , else i wouldnt be here.

but i just made a query and when i do a print_r on the query result.

i get the following.

Array ( [0] => 1 [uitbel_id] => 1 [1] => 320574 [dossier_nr] => 320574 [2] => De heer [aanspreek] => De heer [3] => A.H.M. [voorletters] => A.H.M. [4] => Coomans [achternaam] => Coomans [5] => 0123456789 [telefoon] => 0123456789 [6] => 0 [status] => 0 [7] => 0 [aantalkeergebeld] => 0 )

as you can see the result are 2x on the screen.

i want them to just show up once.

anybody know what is going on???

here is my query

$query1="SELECT * FROM uitbel_lijst";
$ci_query=mysql_query($query1);
$ci_array=mysql_fetch_array($ci_query);
print_r($ci_array)."<br>";

 

thanks in advance!!!

Link to comment
https://forums.phpfreaks.com/topic/38447-double-result-and-i-dont-know-why/
Share on other sites

mysql_fetch_array returns "an array with both associative and number indices" by default.

 

You can use the second argument to the function to change that or use another function such as mysql_fetch_assoc.

$row = mysql_fetch_array($result, MYSQL_ASSOC);
$row = mysql_fetch_assoc($result);

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.