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 Link to comment https://forums.phpfreaks.com/topic/38930-solved-mysql-retrieval-and-creation/ 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()); Link to comment https://forums.phpfreaks.com/topic/38930-solved-mysql-retrieval-and-creation/#findComment-187231 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.