Re: [PHP] Please help with code

2002-04-01 Thread Harry Yu
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 : > > > > > > > > > >

RE: [PHP] Please help with code

2002-04-01 Thread Rick Emery
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

Re: [PHP] Please help with code

2002-04-01 Thread Erik Price
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

Re: [PHP] Please help with code

2002-04-01 Thread Denis L. Menezes
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]

Re: [PHP] Please help with code

2002-04-01 Thread Andrew Brampton
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