GeRik Posted June 9, 2009 Report Share Posted June 9, 2009 (edited) pekshni koda paradijas kljuuda kods ir shads <?php $platums = "160"; // platums px $forums = "/forum"; // foruma url $limits = "5"; // cik daudz jaunumi uzradisies $host = "localhost"; // db hosts $dbname = "forum"; // 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 "<ul><font size='1pt'><div>"; // izvadam jaunumus while($row = mysql_fetch_array( $kverisdivi )) { $datums = $row['start_date']; $piev_datums = date("d/m/Y : H:i:s",$datums); mb_internal_encoding("UTF-8"); echo "<right><img src='images/24.png'><a href=\"$forums/index.php?showtopic=".$row[tid]."&view=getnewpost\" title=\"\">".(strlen($row['title'])>31?substr($row['title'],0,31).'...':$row['title'])."</a> (".$row[posts].") <br>"; } echo "</div></font>"; ?> Edited June 9, 2009 by GeRik Quote Link to comment Share on other sites More sharing options...
max Posted June 10, 2009 Report Share Posted June 10, 2009 Vispirms saac single-quotes (' nevis "). Quote Link to comment Share on other sites More sharing options...
bubu Posted June 10, 2009 Report Share Posted June 10, 2009 GeRik: kāpēc tu mums liec darīt lieku darbu - skaitīt, kura tev tur ir 27. rindiņa? Liec kodu http://paste.php.lv/ lai to automātiski var redzēt. Kļūdas paziņojums ir vistipiskākais situācijai, kad tiek lietots nepareiza sintakse masīva elementa piekļūšanai, piemēram: $arr[posts]. Tā vietā vajag rakstīt $arr["posts"]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.