Re: Problem to insert the field

From: Date: Tue, 08 May 2007 10:51:58 +0000
Subject: Re: Problem to insert the field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-254542@lists.php.net to get a copy of this message
2007. 05. 8, kedd keltezéssel 03.35-kor uni uni ezt írta: > im having problem in making php news. > > I have session variables in login prosses: > > $_SESSION['username']=$rec['username']; > $_SESSION['registered_admin']=TRUE; > > $_SESSION['username'] is taken from "admin" table > > registered_admin can publish the news, and i want to insert the value that were sent from the > "add_news" form into "news" table, one of them is admin_id which is a foreign > key to "admin" table. > > the problem is i do not know how to insert admin_id into "news" table. becoz the > session which is taken from admin table is "username" solution 1: look up the id of the admin in the db when he logs in, store it in the session and later use that value solution 2: look up the id of the admin before inserting into the news table greets Zoltán Németh > > can anyone help me please... > > > > > > > --------------------------------- > Ahhh...imagining that irresistible "new car" smell? > Check outnew cars at Yahoo! Autos.

« previous php.general (#254542) next »