Guest JesusOnline Posted October 5, 2005 Report Share Posted October 5, 2005 Vēlos shitaadu kodu <?php include 'config.php'; include 'opendb.php'; $query = "SELECT ID, name, text, date FROM news"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "ID :{$row['ID']} <br>" . "Name :{$row['name']} <br>" . "zina : {$row['text']} <br>" . "datums : {$row['date']} <br><br>"; } include 'closedb.php'; ?> izvadīt iekš tiem html tagiem nu kaa lai pasaka, aptuveni kaukaa shitaa: <table> <tr> <td ><? echo $ID;?></td> </tr> <tr> <td ><? echo $name;?></td> </tr> <tr> <td ><? echo $text;?></td> </tr> <tr> <td ><? echo $date;?></td> </tr> </table> Ceru ka jautājums ir daudzmaz saprotams Link to comment Share on other sites More sharing options...
bubu Posted October 5, 2005 Report Share Posted October 5, 2005 Tu tak pats esi uzrakstījis arī atbildi uz savu jautājumu... Link to comment Share on other sites More sharing options...
Venom Posted October 5, 2005 Report Share Posted October 5, 2005 aizvieto to, kas ir tagad aiz while iekš {} ar ?> <table> ... </table> <?php + $ID vietā pamaini pret $row['ID'] utt. Link to comment Share on other sites More sharing options...
ohmygod Posted October 5, 2005 Report Share Posted October 5, 2005 (edited) Vovo - pats atbildi uzrakstīji. Kas tev liedz rakstīt kaut vai šādi??? echo'<table>'; while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<tr><td> $row['ID'] </td></tr>" . "<tr><td>$row['name'] </td></tr>" . "<tr><td> $row['text'] </td></tr>" . "<tr><td> $row['date'] </td></tr>"; } echo'</table>'; Edited October 5, 2005 by ohmygod Link to comment Share on other sites More sharing options...
Venom Posted October 5, 2005 Report Share Posted October 5, 2005 while($row = mysql_fetch_array($result, MYSQL_ASSOC)) vietā uzreiz while($row = mysql_fetch_assoc($result)) Link to comment Share on other sites More sharing options...
Guest JesusOnline Posted October 5, 2005 Report Share Posted October 5, 2005 (edited) Lielum liels paldies.... Taa jau reizeem meedz gadiities ka risinaajums pašam ir zinaams, tikai kaukas iebremmzee. Viss griežas... thanks Pamazaam tikai kauko saaku dariities ar to MySQL un taa sintakse man diez ko labi neiet Edited October 5, 2005 by JesusOnline Link to comment Share on other sites More sharing options...
Gacha Posted October 6, 2005 Report Share Posted October 6, 2005 include 'closedb.php'; Diez vai, lai aizvērtu datubāzi nepieciešams inklūdot veselu failu, ja nu vienīgu, tur kaut kas speciāls. Kapēc nelietot vienkāršu mysql_close(); // aizver visas mysql konekcijas Link to comment Share on other sites More sharing options...
Roze Posted October 6, 2005 Report Share Posted October 6, 2005 Diezvai ir īpaši vērts arī mysql_close() rakstīt jo php konekciju aizver automātiski skripta beigās.. Link to comment Share on other sites More sharing options...
Guest JesusOnline Posted October 7, 2005 Report Share Posted October 7, 2005 Tikai ciiņa er vissadiem tizliem tutorials :) Link to comment Share on other sites More sharing options...
Robis Posted October 12, 2005 Report Share Posted October 12, 2005 Nu riktīgs makgaivers! Link to comment Share on other sites More sharing options...
Recommended Posts