Jump to content

Problem with mysql_insert_id()


doubledee

Recommended Posts

When I run this Prepared Statement...

// Build query.
$q2 = "INSERT INTO member(email, activation_code, salt, hash, first_name,
						username, register_ip, register_hostname, location, created_on)
			VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, NOW())";

// Prepare statement.
$stmt2 = mysqli_prepare($dbc, $q2);

// Bind variables to query.
mysqli_stmt_bind_param($stmt2, 'sssssssss', $email, $activationCode, $salt, $hash, $firstName,
					$username, $ip, $hostName, $location);

// Execute query.
mysqli_stmt_execute($stmt2);

// Capture New ID.
$_SESSION['memberID'] = mysql_insert_id();

 

 

I am getting this error...

Warning: mysql_insert_id() [function.mysql-insert-id]: A link to the server could not be established in /Users/user1/Documents/DEV/++htdocs/05_Debbie/members/create_account.php on line 269

 

What am I doing wrong?

 

 

Debbie

 

Link to comment
https://forums.phpfreaks.com/topic/259229-problem-with-mysql_insert_id/
Share on other sites

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.