Hello NogDog and others,
I have tried this thing by doing:
if(isset($_POST['create']))
{
$i = 0;
while ($i == 0)
{
$user_id = sprintf("%'09d", mt_rand(1, 999999999));
$user_id = "P-".$user_id;
echo $user_id;
$query_s = "SELECT user_id FROM access_credentials WHERE user_id = '$user_id'";
$result_s = mysql_query($query_s) OR die("Sorry, unable to select record: " . mysql_error());
$count = mysql_num_rows($result_s);
if($count == 1)
{
$i = 1;
}
}
$query_i = "INSERT INTO user_info (user_id, f_name, m_inital, l_name, email_address) VALUES ('$user_id', '$_POST['f_name']','$_POST['m_inital']','$_POST['l_name']','$_POST['email_address']')";
$result_i = mysql_query($query_i) OR die("Sorry was unable to insert ".$fin." into the database table allowed! <br />" . mysql_error());
$count = mysql_affected_rows();
$query_i = "INSERT INTO access_credentials (user_id, user_password, user_access_level) VALUES ('$user_id', '$_POST['user_password']','0')";
$result_i = mysql_query($query_i) OR die("Sorry was unable to insert ".$fin." into the database table allowed! <br />" . mysql_error());
$count = mysql_affected_rows();
if($count)
{
echo "Account Created";
}
}
does this make any sence? also I am getting the following error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/dev/www/create_account.php on line 38
I have search the internet and I seem not to be able to figure it out, any help would be greatly appericated
Sincerely,
Christopher