close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Another session problem!

Thread began 1/09/2013 3:24 pm by mrs | Last modified 1/09/2013 4:33 pm by Jason Byrnes | 811 views | 3 replies |


Another session problem!

I have a session variable from the SecurityAssist created login pages called SecurityAssist_UserID, and this is being populated fine... I can use this session variable in many places.

I have come to use this on a totally different page to others where I have used it, and I am currently trying to use it in a recordset, but the recordset isn't working as I expected! This is the recordset:

$colname_rs_users = "-1";
if (isset($_SESSION['SecurityAssist_UserID'])) {
$colname_rs_users = $_SESSION['SecurityAssist_UserID'];
mysql_select_db($database_conn_mrs, $conn_mrs);
$query_rs_users = sprintf("SELECT * FROM tbl_users WHERE UserID = %s", GetSQLValueString($colname_rs_users, "int"));
$rs_users = mysql_query($query_rs_users, $conn_mrs) or die(mysql_error());
$row_rs_users = mysql_fetch_assoc($rs_users);
$totalRows_rs_users = mysql_num_rows($rs_users);

As you can see, I am trying to pull through the users info based on the session set when he logged in, but it's not working. I am trying to display the content of the users account on a page, by dropping the bindings onto the page from the recordset, but I am just getting blank regions. The binding of the session variable is displaying fine though!

Again... what am I doing wrong?


Sign in to reply to this post

Jason ByrnesWebAssist

try adding the following code at line 1:

<?php @session_start(); ?>

if you add the following code in the body of the page, it should show the recordset query:

<?php echo($query_rs_users)l ?>

what is the query being returned?

Sign in to reply to this post


Sigh... hours I've been at this problem. In fact, several days on and off!

What exactly is that doing then? Obviously it's starting a session, but I assumed one already existed from when the user logged in.

If I have more than one active session, do I need more than one @session_start?

Thanks Jason.

Sign in to reply to this post

Jason ByrnesWebAssist

no, you only need one @sesson_start() line.

it needs to be on any page that uses the session. PHP often loses visibility to the session unless it is forced to look for it by using the session_start() command.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...