[PHP-DB] inserting blank records into database WHY?
i had created a guestbook in PHP with mySQL database connectivity, i'm taking values from a form SIGN.php -- Name : Location : . . create_entry.php --- Hello Sign my GuestBook!!! but this code is inserting blank records into database why ??? pls help CHADNAN
Re: [PHP-DB] inserting blank records into database WHY?
On Monday 26 August 2002 20:16, murtaza wrote: > i had created a guestbook in PHP with mySQL database connectivity, > i'm taking values from a form > > SIGN.php > -- > > Name : > Location : > . > > . > > > > create_entry.php > --- > Hello > mysql_connect ("localhost", "root", "chandan") or die ("could not connect > to database"); mysql_select_db ("chandan") or die ("could not select the > database"); if ($submit ==$_POST["Sign"] ) > { > mysql_query("INSERT INTO guestbook(name,location,email,url,comments) values > ('$name','$location','$email','$url','$comments')"); echo "Thank you for > singning my guestbook."; > } > else > { > ?> > Sign my > GuestBook!!! } > ?> > > but this code is inserting blank records into database why ??? Did you try finding out exactly what you're trying to insert into the database? IE, what exactly is in your mysql_query("...") statement? IE, what does $name etc, contain? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* It is not doing the thing we like to do, but liking the thing we have to do, that makes life blessed. -- Goethe */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] inserting blank records into database WHY?
- Original Message - From: "murtaza" <[EMAIL PROTECTED]> Date: Mon, 26 Aug 2002 15:16:34 +0300 To: <[EMAIL PROTECTED]> Subject: [PHP-DB] inserting blank records into database WHY? > mysql_query("INSERT INTO guestbook(name,location,email,url,comments) values ('$name','$location','$email','$url','$comments')"); if you don't have register_globals (http://www.php.net/manual/en/security.registerglobals.php) set on, you need to use the $_POST or $_REQUEST array to get at the form variables. namaide monjoy -- ___ Get your free email from http://www.graffiti.net Powered by Outblaze -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] inserting blank records into database WHY?
- Original Message - From: "murtaza" <[EMAIL PROTECTED]> Date: Mon, 26 Aug 2002 15:16:34 +0300 To: <[EMAIL PROTECTED]> Subject: [PHP-DB] inserting blank records into database WHY? > > if ($submit ==$_POST["Sign"] ) shouldn't the if conditional be 'if ($_POST["submit"]=="Sign")'? (or you could just do 'if ($_POST["submit"])', for that matter, yes?) namaide monjoy -- ___ Get your free email from http://www.graffiti.net Powered by Outblaze -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php