|
Posted by Acerola on 12/20/06 21:30
Rik wrote:
>
> 1. Start a session.
> 2. Have an autoincrement column in you database.
> 3. On the first insert, retrieve the mysql_insert_id() from the insert (see
> the manual).
> 4. Store this ID in for instance $_SESSION['quix_id'].
> 5. On subsequent answers, do not INSERT the result, but UPDATE the result
> where the autoincrement column equals $_SESSION['quix_id'].
Thanks. I'm almost there.
I first tested it with echo $_SESSION["id"]; which carries the same id
over the subsequent pages. But, I think my sql query is messed up
because the 2nd question answer is not entering into the db:
$sql = "UPDATE myquiz ( qtwo ) VALUES('$qtwo') WHERE id = $_SESSION[id]";
Answer to question one does get input though:
$sql = "INSERT INTO myquiz ( qone ) VALUES('$qone')";
Navigation:
[Reply to this message]
|