![]() |
Tandy 9/13/2019 |
I have the quiz template and it works great, but I need to add username to the quiz_reponse table which I add a called username. Here is the before display code // insert new response $tblResponse = $dal->Table("quiz_responses"); $tblResponse->Value["testid"]=$_SESSION["testid"]; $tblResponse->Value["startTest"]=runner_date_format("Y-m-d H:i:s"); $tblResponse->Value["username"]=$_SESSION["UserName"]; $tblResponse->Add() I get no error but when I look at the database I get 0 in the field. What I am missing?
|
A
|
aeaton2017 author 9/13/2019 |
Question. Did you put it as a username as a session? In events - Login Page - After successful login: $_SESSION["username"] = $data["username"];
|
A
|
aeaton2017 author 9/13/2019 |
So I was testing to see if my sessions were working and they are by adding a snippet to a page |
N
|
Nir Frumer 9/13/2019 |
is quiz_responses.username has a data type that permits storing $_SESSION['USERNAME'] ? |
A
|
aeaton2017 author 9/13/2019 |
is quiz_responses.username has a data type that permits storing $_SESSION['USERNAME'] ?
|
![]() |
Sergey Kornilov admin 9/13/2019 |
Your SQL query misses single quotes around text value Aaron Easton. Should be 'Aaron Easton'. |
A
|
aeaton2017 author 9/13/2019 |
Your SQL query misses single quotes around text value Aaron Easton. Should be 'Aaron Easton'. My suggestion is to use the Database API that will take care of things like this for you: https://xlinesoft.com/phprunner/docs/db_update.htm
|