aika Posted June 17, 2008 Report Posted June 17, 2008 (edited) $result_from = mysql_query("SELECT * FROM $table",$link_from); while ($row = mysql_fetch_array($result_from)) { while (list($k,$val) = each($row)) { print "$val\n"; } } rezultātā tiek atgriezts mistisks cipars un katra tabulas kolonnas vertība 2vas reizes kapēc? Kas ir nepareizi? Edited June 17, 2008 by aika
andrisp Posted June 17, 2008 Report Posted June 17, 2008 mysql_fetch_array masiivu, kur veertiibas ir gan kaa parasts indekseets masiivs, gan kaa associatiivs. Izmanto mysql_fetch_row vai mysql_fetch_assoc.
aika Posted June 17, 2008 Author Report Posted June 17, 2008 mysql_fetch_array masiivu, kur veertiibas ir gan kaa parasts indekseets masiivs, gan kaa associatiivs. Izmanto mysql_fetch_row vai mysql_fetch_assoc. pareizi! viss tagad štokos - txs!
Ghenis Posted June 17, 2008 Report Posted June 17, 2008 Norādi otro argumentu funkcijai, tad atgriezīs tik vienu atslēgu kolonnai . Konstanti MYSQL_ASSOC izmanto, ja vēlies, lai masīva atslēgās ir kolonnu nosaukumi, bet MYSQL_NUM - lai atslēgas ir secīgi numurētas.
Recommended Posts