Jump to content

Mysql Help


Snaxpac

Recommended Posts

Hey guys,

 

I'm trying to pull an int($id) out of my database, however, whenever I output the result it says 'array'... What am I doing wrong? Is it that I'm storing it into the variable wrong?

 

function getHome($session_id, $email, $encryptedPassword) {

if (! isset($session_id) || ! isset($email) || ! isset($encryptedPassword)){
	return "Login Error: You need to enter a vailid Email and Password! Retuen <a href = index.php>Home</a>";
} else {

	$connection = @ mysql_connect(HOST, USER, PASSWORD)
		or die("Could not connect");
	mysql_select_db(DATABASE, $connection)
		or showerror();

	$salt = substr($email, 0, 2);
	$enc_session_id = crypt($session_id, $salt);

	$query = "SELECT member_id FROM as2_members" .
			   " WHERE email = '$email'" .
			   " AND password = '$encryptedPassword'" .
			   " AND session_id = '$enc_session_id'"
	$result = mysql_query($query, $connection) or showerror();
	$id = mysql_fetch_array($result);
	mysql_close($connection) or showerror();

	return "Logging In... " . $id;
}
}

 

Any help would be great thanks =).

Link to comment
https://forums.phpfreaks.com/topic/106728-mysql-help/
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.