Jump to content

help using session in where clause


deansaddigh

Recommended Posts

at the top of all scripts using $_SESSION data: session_start();

 

$_SESSION['id'] = mysql_real_escape_string(trim($_GET['id'])); (if id is a string)

-OR-

$_SESSION['id'] = (int) trim($_GET['id']); (if id is an integer)

 

Regarding session_register(): "This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged."

Thanks you very much i have changed it per your instructions.

How can i put it in my where clause

 

$query = "SELECT * FROM faq WHERE faq_id = '$_SESSION["id"]";
				$result = mysql_query($query, $conn) 
					or die('Error, query failed');		
		while($row= mysql_fetch_array($result))

 

thanks again

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.