This topic is locked
[SOLVED]

query with session variable not working

9/16/2024 6:56:51 AM
PHPRunner General questions
J
Jan author

Hello everyone, I have a table with the field names "ID" and "name"
In this table there are 2 records:
record1: name = "Mike"
record2: name = "Donald"
In the event "before display" I write the code below:

$_SESSION['name'] = "Mike";

Next I add the session variable to a table, see the code below:

SELECT
ID,
name,
postcode
FROM mytable WHERE name = "$_SESSION['name']}"

But the record ( with the name "Mike" ) is not visible, what am I doing wrong?

mbintex 9/16/2024

You need to use the SQL Variables in the query screen.

https://xlinesoft.com/phprunner/docs/sql_variables.htm

J
Jan author 9/16/2024

Thanks for the tip