Calling all experts, as a newbie, i'm trying to insert data from a html form to mysql, please see my below php scripts. i'm using php5.0.2, mysql 4.1 and apache 2.0.52 on script1, its always telling me that i have not entered all data, if i get rid of this line if (!$isbn || !$author || !$title || !$price), it actually works, but nothing in mysql database, just empty row. same on script2 only empty rows. please let me know what i did wrong. all feedback is very very much appreciated. script1==> [code]<html> <head><title> Book entry homepage</title> </head> <body> <h1> Book Entry Results</h1> <?php //create short var names $isbn = $HTTP_POST_VARS['isbn']; $author = $HTTP_POST_VARS['author']; $title = $HTTP_POST_VARS['title']; $price = $HTTP_POST_VARS['price']; if (!$isbn || !$author || !$title || !$price) { echo 'You have not entered all required details <br />'.'Please go back and try again.'; exit; } $isbn = addslashes($isbn); $author = addslashes($author); $title = addslashes($title); $price = doubleval($price); @ $db = mysql_pconnect ('localhost', 'root', 'password'); if (!$db) { echo 'cannot connect to database try again later'; exit; } mysql_select_db ('testaj'); $query = "INSERT INTO books VALUES ('".$isbn."', '".$author."', '".$title."', '".$price."')"; $result = mysql_query($query); if ($result) echo mysql_affected_rows().'book entered into database.'; ?> </body> </html>[/code] script 2==> [code]<? //create short var names $firstName = $_POST['firstName']; $lastName = $_POST['lastName']; /*if ($firstName or $lastName ) { echo 'You have not entered all required details <br />'.'Please go back and try again.'; exit; } $firstName = addslashes($firstName); $lastName = addslashes($lastName); */ @ $db = mysql_pconnect ('localhost', 'root', 'password'); if (!$db) { echo 'cannot connect to database try again later'; exit; } mysql_select_db ('demo'); $query = "INSERT INTO members (firstName, lastName) VALUES ('".$firstName."', '".$lastName."')"; $result = mysql_query ($query); if ($result) echo mysql_affected_rows() .'name entered into database.'; ?> </body> </html>[/code]