You are here: Re: sessions question « All PHP « IT news, forums, messages
Re: sessions question

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация