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 ('[email protected]', 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

 

Archived

This topic is now archived and is closed to further replies.

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