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); Quote Link to comment 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? Quote Link to comment 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" Quote Link to comment 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"); Quote Link to comment 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 :-\ Quote Link to comment 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? 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.