Artenis Posted April 6, 2007 Report Share Posted April 6, 2007 (edited) Tātad lietojot phpBB forumu! Izdomāju, ka savā flash lapelē varētu ielādēt pēdējos 5 topicus, viss būtu labi, ja php no mysql neielādētu kaut kādus topicus uz dullo... :(.... Lietojot: ORDER BY ID DESC man meta erroru: Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\apache\htdocs\exlapa\v3\foruma_jaunumi.php on line 15 Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\apache\htdocs\exlapa\v3\foruma_jaunumi.php on line 16 Lūk kur var apskatīt rezultātu: http://extremelv.sytes.net/exlapa/v3/foruma_jaunumi.php Rekur scripts: <? include_once("xxx.php"); mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM phpbb_topics"; $result=mysql_query($query); mysql_close(); echo "<b>Pedejie posti</b><br><br>"; $i=0; echo "&pedejie="; while ($i < 5) { $topic_id=mysql_result($result,$i,"topic_id"); $topic_title=mysql_result($result,$i,"topic_title"); echo '<a href="' . "http://localhost/forums/" . 'viewtopic.php?p=' . $topic_id . '">' . $topic_title . '</a>'.'<br>'; $i++; } ?> Lūk ar šo scriptu viss gāja, tikai problēma tā, ka php no MySQL nepaņēma pēdējostopicu, bet uz dullo kaut kādus!!! :) Edited April 6, 2007 by Artenis Link to comment Share on other sites More sharing options...
bubu Posted April 6, 2007 Report Share Posted April 6, 2007 Kad reiz cilvēki iemācīsies apstrādāt korekti kļūdas... if (!$result) die(mysql_error()); Link to comment Share on other sites More sharing options...
andrisp Posted April 6, 2007 Report Share Posted April 6, 2007 Kveriju vajag pareizu uzrakstīt. SELECT * FROM phpbb_topics ORDER BY datums ASC LIMIT 5 Tik neatceros vai ASC vai DESC :) Link to comment Share on other sites More sharing options...
Roze Posted April 6, 2007 Report Share Posted April 6, 2007 DESC Link to comment Share on other sites More sharing options...
Recommended Posts