Reputation: 51
im trying to insert values on form submit but no result nothing is entering in the databse not even empty values,
if(isset($_POST['signup'])) {
mysql_query("INSERT INTO user (fname, lname)
VALUES ('Peter', 'Griffin')");
}
i checked if theres connection to database and it's connected. ANYONE ?
Upvotes: 0
Views: 99
Reputation: 5108
Execute the query directly in query browser or any of mysql editors and check whether it is inserted. If it is inserted successfully, just check like this.
if(isset($_POST['signup'])) {
echo "Inside";
exit;
mysql_query("INSERT INTO user (fname, lname)
VALUES ('Peter', 'Griffin')");
}
If it doesn't display Inside, then the problem is in if(isset($_POST['signup']))
. Check it.
Upvotes: 2