hyeteck Posted February 17, 2007 Share Posted February 17, 2007 hey guys..is the following code legal? I don't think its working for me $cat_id = mysql_query("SELECT `sectionID` from `sections` WHERE `sectionName`='$cat_segment', 'topSection'!='0' "); if($cat_id==NULL) { $temp = mysql_query("INSERT INTO `sections`(sectionName, sectionWorkingName, topSection, rootSection) VALUES('$cat_segment', '$cat_segment', '0', '0')"); } do i have to do something to extract the data from $cat_id or will it automatically just return the data from the database into the $cat_id as a string? thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 17, 2007 Share Posted February 17, 2007 Don't put field names in quotes, and read the mysql manual. $cat_id = mysql_query("SELECT sectionID from `sections` WHERE sectionName='$cat_segment' AND topSection !='0' ") or die(mysql_error()); 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.