Publisher Bucks |
11-23-2022 10:27 AM |
Session Name in SQL query?
What is the best way to include into an SQL query please?
I want to do something along these lines (which isnt the correct way apparently lol):
Quote:
$con=mysqli_connect("localhost","USER","PASS","DB" );
$result = mysqli_query($con,"SELECT * FROM Documents WHERE Writer REGEXP '<?=$_SESSION['name']?>' ORDER BY ID DESC;");
while($row = mysqli_fetch_array($result))
|
Basically, any time one of my writers logs into the admin system, I want it to display the documents they've completed based on their login name to them and I figured using the session name would be the easiest way, as it gets attached on submission and stored in the DB in the 'Writer' column, I just can't figure out how to get that info to display on a page through an SQL query :Oh crap
|