Dooling Posted March 30, 2005 Report Share Posted March 30, 2005 Lieta tāda, ka mans kods, parāda tikai vienu ierakstu no datu bāzes, bet man vajag, lai parāda visus datus $hostname = "localhost"; $dbuser = "turists"; $dbpass = ""; $dbname = "BDA"; mysql_connect($hostname,$dbuser,$dbpass); mysql_select_db("$dbname"); $query = "select * from monitori"; $result = mysql_query($query); while($row = mysql_fetch_array($result)) { $nos = $row["nosaukums"]; $raz = $row["razotajs"]; $ser = $row["serija"]; $mod = $row["modelis"]; $yrs = $row["iz_gads"]; $stat = $row["statuss"]; $com = $row["comment"]; } echo $nos; echo $raz; echo $ser; echo $mod; echo $yrs; echo $stat; echo $com; Kā lai parāda visus datus no datu bāzes? Link to comment Share on other sites More sharing options...
Venom Posted March 30, 2005 Report Share Posted March 30, 2005 tu izvadi mainīgos tikai pēc tam kad while cikls tev ir pārskrējis visas rindas (resp. tikai pēdējo rindu) jābūt: while($row = mysql_fetch_array($result)) { //izvads ar echo vai tml. šeit, piem: print_r($row); } Link to comment Share on other sites More sharing options...
Recommended Posts