Here's my code... (the part that's causing error).
When this is run it shows the last error message (Error. If problem persists...). I know that the problem is in the forum edit area because I just added it and the script works fine without it.Code:$query = "SELECT handle FROM users WHERE (handle='$handle')"; $checkhandle = mysql_query($query); if(mysql_num_rows($checkhandle)) {teX("$handle already exists, please click your browser's back button and choose a different user name.","verify2");} else { $im = $_POST['imname']."|".$_POST['imservice']; include('i_aeskey.php'); //sets $AES_key variable $query = "INSERT INTO `users` ( `email` , `name` , `phone` , `im` , `date` , `password` , `handle` ) VALUES ( '$email', '$name', '$phone', '$im', CURDATE( ) , AES_ENCRYPT('$pass','$AES_key'), '$handle' );"; //Add a forum account for user... $rzdb = mysql_connect('localhost', 'username', 'password'); mysql_select_db("haydur_phpb1"); $getmax = mysql_query("SELECT MAX(user_id) FROM phpbb_users", $rzdb); $user_id = $getmax + 1; $rccreg = mysql_query("INSERT INTO phpbb_users ( 'user_id', `user_email` , `user_regdate` , `user_password` , `username` ) VALUES ('$user_id', '$email', time() , md5($password), '$handle' ), $db2);", $rzdb); mysql_close($rzdb); //End forum edit $result = mysql_query($query); if($result) {teX("User $handle has been added.","verify2");} else {teX("Error. If problem persists please contact system administrator.","caution");} } }
Also note that the user_id variable is a phpBB field unique to each user. For some reason it is scriptically incremented instead of being auto incremented. And that's what I need to do, in addition to getting the data written to the table.






Bookmarks