andrew6607 Posted February 1, 2008 Share Posted February 1, 2008 Hello, I have been Spending Almost A Hour Trying to Figure This Out. I have solved it before but i cant figure out how i did it. Please HELP!! Here is the error it gives: MySQL Said: 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 '*INTO new_members ( fname, lname, email, username, password ) values( 'Andre' at line 1 Now Here Is The PHP CODE: <?php include( 'includes/config.php' ); //Get Data From Forum $fname = $_POST['fname']; $lname = $_POST['lname']; $email = $_POST['email']; $username = $_POST['username']; $password = $_POST['password']; $cpassword = $_POST['cpassword']; //Validate Info if( $fname == false || $lname == false || $email == false || $username == false || $password == false ) { echo "Please Fill Out All The Feilds!!"; } if( $password == $cpassword ) { $link = mysql_connect( $db_host, $db_username, $db_password ); if( ! $link ) { die ( "MySQL Said: ".mysql_error() ); } $db = mysql_select_db( $db_database, $link ); if( ! $db ) { die ("MySQL Said: ".mysql_error() ); } $query = "INSERT *INTO new_members ( fname, lname, email, username, password ) values( '$fname', '$lname', '$email', '$username', '$password' )"; mysql_query( $query, $link ) or die ( "MySQL Said: ".mysql_error() ); mysql_close( $link ); }else{ echo "Your Passwords Dont Match"; } ?> Thanks!! Andrew E Quote Link to comment https://forums.phpfreaks.com/topic/88863-solved-sql-syntax-error/ Share on other sites More sharing options...
pdkv2 Posted February 1, 2008 Share Posted February 1, 2008 Just remove the * from your insert query ! Cheers. Quote Link to comment https://forums.phpfreaks.com/topic/88863-solved-sql-syntax-error/#findComment-455127 Share on other sites More sharing options...
andrew6607 Posted February 1, 2008 Author Share Posted February 1, 2008 Thank You Sir!! ;D Quote Link to comment https://forums.phpfreaks.com/topic/88863-solved-sql-syntax-error/#findComment-455128 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.