Re: Please help
| From: | Miguel Cruz | Date: | Tue, 26 Mar 2002 16:08:31 +0000 |
| Subject: | Re: Please help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-90210@lists.php.net to get a copy of this message | ||
On Tue, 26 Mar 2002, Denis L. Menezes wrote:
> I am a newbie and need some help.
>
> I have a form with three textboxes named "firstname", "lastname" and
> "description"
>
> My table is called "addressbook"
>
> Please tell me the INSERT statement. Also please tell me whether I should
> include the insert statement with a php tag.
Assuming that you're using MySQL, you have already opened the database
connection, and that you have magic_quotes_gpc set to on (ugh, but check
with print ini_get('magic_quotes_gpc') ), it would look something like
this:
$sql = "insert into addressbook (firstname, lastname, description)
values ('{$_REQUEST['firstname']}',
'{$_REQUEST['lastname']}',
'{$_REQUEST['description']}')";
$st = mysql_query($sql);
miguel