[nycphp-talk] next challenge
gadhra
bfeqx44002 at sneakemail.com
Sun May 11 21:52:24 EDT 2003
Hi Joshua,
The inserts can be broken apart into different tables by using different
sql queries. For example:
$sql[0] = "insert into table1 values ($_POST[1],$_POST[2])";
$sql[1] = "insert into table2 values ($_POST[3],$_POST[4])";
$res[0] = mysql_query($sql[0]);
$res[1] = mysql_query($sql[1]);
As for file upload - I would recommend checking out
http://www.php.net/manual/en/features.file-upload.php for some great,
secure examples. As a caveat, nota bene that you need to use the <input
type="file"> form field and make sure the form type is set to
enctype="multipart/form-data".
+gadhra+
Joshua S. Freeman jfreeman-at-amnh.org |NY PHP| wrote:
>I have built a database with about 12 tables
>
>I have a <form></form> which is long-ish but not so long that it HAS to be
>broken up into multiple pages.
>
>The problem is, on submit, I need different form values to be submitted to
>different tables in the database. How do I build an insert statement like
>that?
>
>Also... people are supposed to be able to upload an image with this project.
>I think best practices call for storing the image in a file and using php to
>create a link to that image which gets stored as a text 'url' in the
>database associated with the record it needs to show up in...
>
>How is *this* accomplished? *this* being... asking for someone to somehow
>insert the local image path and then, on submit, moving the image to the
>right place on the server and creating the 'url' that goes into the database
>and putting it in the database?
>
>Thanks for any pointers...
>
>Cheers,
>
>J.
>
>
>
>
>--- Unsubscribe at http://nyphp.org/list/ ---
>
>
>
>
>
>
>
More information about the talk
mailing list