Re: Two php pages and a single column

From: Date: Sun, 12 Nov 2000 05:45:53 +0000
Subject: Re: Two php pages and a single column
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-24840@lists.php.net to get a copy of this message
If you have to pass it across, in the first page you could use mysql_insert_id() to get the number of the auto_increment field of the row that was just inserted. You could now either use a cookie or register this value with a session to pass it to the next page which will do an update rather than an insert. Sessions are purely PHP4 so if you have PHP3 you have a problem and should think of cookies (there are session functions for php3 but they are an add on). Avoid passing the row id on the URL because that opens a bag of security holes.
Hello all, I am having two different php pages(scene1.php and scene2.php) and in the first page i am collecting the 'firstname' and in the second page i am collecting the 'lastname' and i am using the following queries respectively in those two php pages: mysql_query ("insert into usertable (firstname) values ($firstname)"); mysql_query ("insert into usertable (lastname) values ($lastname)"); What my problem is, i want these two details to be in the same row not in two different rows as that is the case now as shown below: -------------------------- firstname |lastname --------------------------
   john    |  null
--------------------------
   null    |   deo
-------------------------- I want it to be as below: -------------------------- firstname |lastname --------------------------
   john    |  deo
-------------------------- As i don't have the idea about who is going to be the user i am not able to use a command like this in the second page: mysql_query ("insert into usertable (lastname) values ($lastname) where firstname='john'"); Can any body suggest me how to get around this problem. Does MySQL and PHP entertain this feature?
Dave Appleton                                  Calistra ODBC mySQL Administrator
Calistra Research Labs               http://www.calistra.com/MySQL
101A Upper Cross Street #08-17 People's Park Centre Singapore 058357 Tel : 534-0019 Fax : 534-0919

« previous php.general (#24840) next »