Re: Film Database
| From: | John Parker | Date: | Wed, 12 Jul 2000 18:49:36 +0000 |
| Subject: | Re: Film Database | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1083@lists.php.net to get a copy of this message | ||
Hmmmm............
The most obvious way would be to insert the film_details and
cast_details table then query them back to get the video_id and film_id
info (using a select query, actually two select queries). But I can't
help think that there's a better way. List- Any options??
John Parker
Tim Jones wrote:
>
> Oh - I just thought of another question - I hope you don't mind...
>
> I am using the SERIAL data type in my PostgreSQL database to increment the
> video id and film id counters for each new record - this will be okay for
> adding to the film_details and cast_details tables, but how do I add the
> correct info to the video_details table?
>
> Tim
>
> ----- Original Message -----
> From: John Parker <jparker@omniquip.textron.com>
> To: <tj198@soton.ac.uk>; <php-db@lists.php.net>
> Sent: Wednesday, July 12, 2000 2:23 PM
> Subject: Re: Film Database
>
> > Sure no problem. Make a form to get all the relevant info and pass it
> > to a php page.
> > In the PHP code create the relevant Insert queries of the form:
> >
> > $query1 = sprintf("INSERT INTO video_details (video_id,film_id,format)
> > VALUES (%s,%s,%s)",$video_id,$film_id,$format);
> > $query2 = sprintf("INSERT INTO film_details (film_id,title,director)
> > VALUES (%s,%s,%s)",$film_id,$title,$director);
> > $query3 = .... you get the idea.
> >
> > then execute the queries in your preferred manner (depending on the
> > database you're using, e.g.
> > mysql_query($query1);
> > mysql_query($query2);
> > ....
> >
> > There is no problem running multiple queries to different tables in the
> > same script.
> >
> > Hope this helps.
> >
> > Sincerley,
> >
> > John Parker
> >
> > > Hi, I am wanting to set up a small database, initially with a list of
> the
> > > video cassettes and dvds that I own.
> > >
> > > I want to have three tables - one with the video details (video id, film
> id,
> > > and format - dvd or vhs), one with film details (film id, film title,
> > > director), and one with the cast details (film id, cast).
> > >
> > > I can set these tables up okay, but how do I go about writing a form in
> PHP
> > > to allow me to add to the database? I want to write one form that allows
> me
> > > to add information to all three tables at one time. Is this possible?
> > >
> > > Any help would be much appreciated.
> > >
> >
> > --
> > John Parker, Design Engineer, Snorkel International
> > Ph: 816/676-6419 Fax: 785/989-3556
> >
--
John Parker, Design Engineer, Snorkel International
Ph: 816/676-6419 Fax: 785/989-3556