You forgot to select the database that you want to
insert.
Ex:
$db = mysql_select_db ( mydatabase );
Hope this helps,
Harry
--- "Denis L. Menezes" <[EMAIL PROTECTED]>
wrote:
> Hello friends,
>
> can someone tell me what is wrong with this code :
>
>
>
>
>
>
>
>
>
>
You CANNOT execute the PHP script until the form is submitted. You are
attempting to do both at the same time.
Second, ALL your text fields muse be surrounded by quotes in your INSERT
statement.
Third, use NULL, not UNIX_TIMESTAMP() to insert a timestamp field.
In the following, assume the name
On Monday, April 1, 2002, at 11:08 AM, Denis L. Menezes wrote:
> $query="INSERT INTO news (newsid,title, author, body, posted)
> VALUES($newsid,$title, $author, $body, UNIX_TIMESTAMP())";
> IF (mysql_query($query)){
> print "Row added to table";
> } else {
> print "error adding r
Should I change the position of the php code?
Thanks
denis
- Original Message -
From: "Andrew Brampton" <[EMAIL PROTECTED]>
To: "Denis L. Menezes" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, April 02, 2002 12:31 AM
Subject: Re: [PHP]
You are not actually posting the form to a page with your PHP on... so its
trying to insert that form into your DB before u actually fill it out.
either check if the form has been posted before running your PHP, or split
this into 2 pages
Andrew
- Original Message -
From: "Denis L. Meneze
5 matches
Mail list logo