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
> --------------
> <form  action="create_entry.php" method="POST">
> Name : <input type="text" name="name" size="40">
> Location : <input type="text" name="location" size="40">
> .....................................
> ............
> .........
> <input type="submit" name="submit" value="Sign">
> </form>
>
> create_entry.php
> -----------------------
> Hello <?php echo $_POST["name"]; ?>
> <?php
> 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
> {
> ?>
> <h5><font face="Verdana"><a href="sign.php">Sign my
> GuestBook!!!</a></font></h5> <?php
>  }
> ?>
>
> 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

Reply via email to