Jump to content

Query fails on one m/c and works on the other?


Lassie

Recommended Posts

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.