Jump to content

Stuck on SQL Statement


Kev0121

Recommended Posts

Well in my database in my users table i have a field called 'active' and when users are logged in it changes to 1. What im trying to do is write a sql statement that says check if the user id of $_SESSION['uid'] if their active field is set to 1, if so echo out "Online" if that makes sense? sorry lol didnt know how to describe.

 

something like this...

$sql = "SELECT active FROM users WHERE active = 1 AND  id = ' " . $_SESSION['uid'] . " ' ";

 

Thanks

 

/Kev

Link to comment
https://forums.phpfreaks.com/topic/154787-stuck-on-sql-statement/
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.