Lassie Posted February 20, 2007 Share Posted February 20, 2007 I have a development laptop and a server. Both have the same db etc and versions of php,mysql I have a registration script that works on my local m/c but fails on the server(which is not hosted) when trying an insert query. The alias are created in the input check code. I cant see where to look for an error. Any help appreciated. $query = "SELECT user_id FROM users WHERE email='$e'"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysql_num_rows($result) == 0) { // Available. // Create the activation code. $a = md5(uniqid(rand(), true)); // Add the user. $query = "INSERT INTO users (email, pass, first_name, last_name, active, registration_date) VALUES ('$e', SHA('$p'), '$fn', '$ln', '$a', NOW() )"; $result = mysql_query ($query) or trigger_error("Query: $query\n<br />MySQL Error: " . mysql_error()); if (mysql_affected_rows() == 1) { // If it ran OK. An error occurred in script 'c:\easyserv\www\reg\register.php' on line 65: Query: INSERT INTO users (email, pass, first_name, last_name, active, registration_date) VALUES ('hawkesleyhouse@btinternet.com', SHA('horatio1'), 'Ray', 'Pocock', 'f585bac1567c50d878e3a8490399210e', NOW() ) MySQL Error: You have an error in your SQL syntax near '('horatio1'), 'Ray', 'Pocock', 'f585bac1567c50d878e3a8490399210e', NOW() )' at line 1 Date/Time: 2-20-2007 18:09:17 error message Quote Link to comment Share on other sites More sharing options...
fenway Posted February 20, 2007 Share Posted February 20, 2007 I thought it was SHA1()... maybe the versions are different, and they added a synonym? Quote Link to comment Share on other sites More sharing options...
Lead Posted February 20, 2007 Share Posted February 20, 2007 Also you may want to check the datatypes of your fields, just to make sure. Quote Link to comment Share on other sites More sharing options...
Lassie Posted February 20, 2007 Author Share Posted February 20, 2007 Thanks guys I will look into both. 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.