Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.