Jump to content

Make directory on new user sign-up


Gafferzone

Recommended Posts

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

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  :-\

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.