Me and a friend are making our own forum software but i've come to a problem with pulling from the database, this is the error i keep getting:
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 'desc FROM forums WHERE active = '1' && catid = '1' ORDER BY for
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\web\snbb\functions.php on line 262
now this is the coding around that area:
PHP Code:php:$sql = "SELECT fid, title, desc FROM forums WHERE active = '1' && catid = '$c_id' ORDER BY forum_order ASC";
$forums = mysql_query($sql);
echo mysql_error();
while($f=mysql_fetch_array($forums))
{
and this is the database structure that it is pulling from:
I have no idea why it isn't working, the query seems fine to me, the database structure seems fine and and so does the other coding.Code:CREATE TABLE `forums` ( `fid` int(10) unsigned NOT NULL auto_increment, `title` varchar(50) NOT NULL default '', `desc` varchar(255) NOT NULL default '', `active` int(11) NOT NULL default '1', `catid` int(11) NOT NULL default '0', `forum_order` decimal(10,0) NOT NULL default '1', `levels` varchar(50) NOT NULL default '', PRIMARY KEY (`fid`) ) TYPE=MyISAM ;![]()
Can anyone else help me?
Thanks,
Rick








Bookmarks