aika Posted June 17, 2008 Report Share 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 Link to comment Share on other sites More sharing options...
andrisp Posted June 17, 2008 Report Share 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. Link to comment Share on other sites More sharing options...
aika Posted June 17, 2008 Author Report Share 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! Link to comment Share on other sites More sharing options...
Ghenis Posted June 17, 2008 Report Share 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. Link to comment Share on other sites More sharing options...
Recommended Posts