Re: Film Database
| From: | John Parker | Date: | Wed, 12 Jul 2000 13:23:59 +0000 |
| Subject: | Re: Film Database | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-1073@lists.php.net to get a copy of this message | ||
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