Gafferzone Posted December 20, 2010 Share Posted December 20, 2010 Hi guys, I've got a snippet of code that's supposed to make a new directory with the user's unique ID (member_id) in the database. I have the code here but I get a myriad of errors including the infamous "at line 1 error, and the directory does not create. Please help me!! //Create Directory $queryString2 = $_SERVER['QUERY_STRING']; $query2 = "SELECT member_id FROM members WHERE $queryString2 = $row[activation]"; $result2 = mysql_query($query2) or die(mysql_error()); mkdir("/home/gafferzo/www/members/clubs/" . mysql_result($result2,0), 0777); Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/ Share on other sites More sharing options...
Pikachu2000 Posted December 20, 2010 Share Posted December 20, 2010 And which 'infamous at line 1' error would that be? Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/#findComment-1149614 Share on other sites More sharing options...
Gafferzone Posted December 20, 2010 Author Share Posted December 20, 2010 Hi Pikachu, I get this: "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 '=' at line 1" Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/#findComment-1149615 Share on other sites More sharing options...
BlueSkyIS Posted December 20, 2010 Share Posted December 20, 2010 that error message is more of a help if you actually look at the SQL it is referring to. $query2 = "SELECT member_id FROM members WHERE $queryString2 = $row[activation]"; $result2 = mysql_query($query2) or die(mysql_error() . " IN $query2"); Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/#findComment-1149625 Share on other sites More sharing options...
Gafferzone Posted December 21, 2010 Author Share Posted December 21, 2010 that error message is more of a help if you actually look at the SQL it is referring to. $query2 = "SELECT member_id FROM members WHERE $queryString2 = $row[activation]"; $result2 = mysql_query($query2) or die(mysql_error() . " IN $query2"); I used your advice and found that removing the quotes round the $query2 line got rid of my line 1 error, but now using this code I have the following error: //Create Directory $queryString2 = $_SERVER['QUERY_STRING']; $query2 = SELECT member_id FROM members WHERE $queryString2 = $row[activation]; $result2 = mysql_fetch_row($query2) or die(mysql_error()); mkdir("/home/gafferzo/www/members/clubs/" . mysql_result($result2,0), 0777); Parse error: syntax error, unexpected T_STRING in /home/gafferzo/public_html/verify.php on line 28 Gaahhhh I am so confused :-\ Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/#findComment-1149931 Share on other sites More sharing options...
Pikachu2000 Posted December 21, 2010 Share Posted December 21, 2010 Because you left the entire query string unquoted, perhaps? Link to comment https://forums.phpfreaks.com/topic/222234-make-directory-on-new-user-sign-up/#findComment-1149996 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.