Jump to content

execute SQL and set a session


jarv

Recommended Posts

hi,

 

I am having problems setting a session from a SQL query, please help... here is my code:

 

$query1 = "SELECT * FROM members_copy WHERE rsUser = '$username' AND rsPass = '$password'";
$result1 = mysql_query($query1);
echo "<br>".$result1['USERID'];


$_SESSION['s_logged_n'] = 'true';
$_SESSION['s_username'] = $username;
$_SESSION['USERID']=$result1['USERID'];
$_SESSION['RSTOWN']=$result1['RSTOWN'];
$_SESSION['RSEMAIL']=$result1['RSEMAIL'];
$_SESSION['RSUSER']=$result1['RSUSER'];

 

no sessions are currently being set?!

:-\

Link to comment
https://forums.phpfreaks.com/topic/227369-execute-sql-and-set-a-session/
Share on other sites

ok so I changed my code to

$query1 = "SELECT * FROM members_copy WHERE rsUser = '$username' AND rsPass = '$password'";
$result1 = mysql_fetch_array($query1);
echo "<br>".$result1['USERID'];

 

and now I get the following error:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\mypubspace.com\wwwroot\mobile\dologin.php on line 19

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.