suport Posted February 2, 2010 Report Share Posted February 2, 2010 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and parent = 0' at line 1 sql kods: SQL KODS: <? $sql = "SELECT * FROM `ura_items` WHERE CategoryID != 2 AND CategoryID != 1 AND CategoryID != 0 ORDER BY `Add_Date` DESC LIMIT 10"; $result = @mysql_query($sql); if( !$result ) { echo "MySql Error: ".mysql_error(); } $i = 0;// for alternative row color while( $row = mysql_fetch_assoc($result) ){ echo "<li><a href=\"".seo_links('detail', $row['ProductID'], $row['ProductName'], 1, _SEO)."\">".fewchars($row['ProductName'], 60)."</a> <span class=\"date_right\">".nice_date($row['Add_Date'])."</span></li>"; echo "<li class=\"shortdesc\">".fewchars($row['LongDesc'], 140)."</li>"; $i++; } ?> Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted February 2, 2010 Report Share Posted February 2, 2010 nav tas kods, jo šajā pilnīgi nekur nav koda fragmenta: and parent = 0 Quote Link to comment Share on other sites More sharing options...
2easy Posted February 2, 2010 Report Share Posted February 2, 2010 (edited) lol true es vienīgi varu ieteikt mysql_query() vietā lietot slaveno go() funkciju function go($sSql) { // izpilda mysql query $h = mysql_query($sSql) or exit('<b>mysql_query() error ' . mysql_errno() . ':</b> ' . mysql_error() . '<br /><b>query:</b> ' . substr($sSql, 0, 1000)); return $h; } tā uzreiz pasaka arī sql, kur bija kļūda Edited February 2, 2010 by 2easy 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.