ashais13 Posted January 7, 2009 Report Share Posted January 7, 2009 Problēma: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\host\jaunakais.php on line 18 Jaunakais php: <?php $platums = "160"; // platums px $forums = "http://forums"; // foruma url $limits = "6"; // cik daudz jaunumi uzradisies $host = "localhost"; // db hosts $dbname = "******"; // foruma datubaze $dbuser = "root"; // foruma db users $dbpass = "*******"; // juusu foruma datubaazes parole $link = mysql_connect($host, $dbuser, $dbpass) or die("NEsanaaca piekontektities: " . mysql_error()); mysql_select_db($dbname) or die("Datubaaze neekstistee"); mysql_query("SET NAMES UTF-8"); // lai rada LV alfabetu // dabuunam datus no DB $kverisdivi = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT ".$limits.""); echo "<div>"; // izvadam jaunumus while($row = mysql_fetch_array( $kverisdivi )) { $datums = $row['start_date']; $piev_datums = date("d/m/Y : H:i:s",$datums); echo "<p><b>Kur:</b> <a style='text-decoration: none' href=\"$forums/index.php?showtopic=".$row[tid]."&view=getnewpost\" title=\"\">".$row[title]."</a> | <strong>".$row[posts]."</strong><br> <b>Kas:</b> <a style='text-decoration: none' href=\"http://forums/index.php?showuser=".$row[last_poster_id]."\" title=\"\">".$row[last_poster_name]."</a></p>"; } echo "</div>"; ?> Link to comment Share on other sites More sharing options...
xPtv45z Posted January 7, 2009 Report Share Posted January 7, 2009 query nepareizs. Link to comment Share on other sites More sharing options...
bubu Posted January 7, 2009 Report Share Posted January 7, 2009 Cik reizes var atkārtoties: $kverisdivi = mysql_query("..."); if (!kverisdivi) { die(mysql_error()); } Link to comment Share on other sites More sharing options...
ashais13 Posted January 7, 2009 Author Report Share Posted January 7, 2009 Nekaa, erroru nerada, bet nerada ari to kas butu jarada. Kur: | Kas: Link to comment Share on other sites More sharing options...
sayed Posted January 11, 2009 Report Share Posted January 11, 2009 Ir kādam darbojošs šis skripts? :) Link to comment Share on other sites More sharing options...
Odyssey Posted March 7, 2009 Report Share Posted March 7, 2009 <?php $platums = "160"; // platums px $forums = "http://izeed-dirsu.lv/forums"; // foruma url $limits = "5"; // cik daudz jaunumi uzradisies $host = "localhost"; // db hosts $dbname = "ipb"; // foruma datubaze $dbuser = "root"; // foruma db users $dbpass = "neteiksu"; // juusu foruma datubaazes parole $link = mysql_connect($host, $dbuser, $dbpass) or die("NEsanaaca piekontektities: " . mysql_error()); mysql_select_db($dbname) or die("Datubaaze neekstistee"); mysql_query("SET NAMES UTF-8"); // lai rada LV alfabetu // dabuunam datus no DB $kverisdivi = mysql_query("SELECT posts, last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM ibf_topics ORDER BY last_post DESC LIMIT ".$limits.""); echo "<div>"; // izvadam jaunumus while($row = mysql_fetch_array( $kverisdivi )) { $datums = $row['start_date']; $piev_datums = date("d/m/Y : H:i:s",$datums); echo "<p><b>Kur:</b> <a style='text-decoration: none' href=\"$forums/index.php?showtopic=".$row[tid]."&view=getnewpost\" title=\"\">".$row[title]."</a> | <strong>".$row[posts]."</strong><br> <b>Kas:</b> <a style='text-decoration: none' href=\"$forums/index.php?showuser=".$row[last_poster_id]."\" title=\"\">".$row[last_poster_name]."</a></p>"; } echo "</div>"; ?> Link to comment Share on other sites More sharing options...
ashais13 Posted March 7, 2009 Author Report Share Posted March 7, 2009 Thx odysey.. ;) Link to comment Share on other sites More sharing options...
Recommended Posts