Jump to content

Prepared Statement - Row as array()


malikah

Recommended Posts

Just wondering how to get the whole row as an array in the following prepared statement:

 

function verifyUsernameAndPass($un, $pw)
{
$query = "SELECT * FROM login WHERE user = ? AND pass = ? LIMIT 1";

if($stmt = $this->conn->prepare($query))
{
	$stmt->bind_param('ss', $un, $pw);
	$stmt->execute();

	if($stmt->fetch())
	{
		$stmt->close();
		return true;
	}
}
}

Link to comment
https://forums.phpfreaks.com/topic/166989-prepared-statement-row-as-array/
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.