hello everyone i'm new to php and to this forum, i need help with this code, but i don't know what i'm doing wrong......i'm getting erro on this line ....mysql_query($ret);
i commented it out and appears to work, but still nothing is entered into the db...
thanxs in advance ...
// this is the code that i'm using ....
<?php
//connect config data
$dbhost = "125.0.0.1";
$dbuser = "nbrec";
$dbpass = "mwhitexxx";
$dbname = "nbrec_com-db";
//mysql connect form
$connect = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die(mysql_error());
mysql_select_db("$dbname", $connect) or die(mysql_error());
//calleing function on submit button
if(isset($POST["submitREGbt"])) update();
// or
if(!empty($POST["submitREGbt"])) update();
//executive function on submit button
function update()
{
if($_POST["submitREGbt"]!="")
{
$ret = "INSERT INTO RegistrationTBL VALUES('', '$name', '$lname', '$email', '$sex', '$age', '$address', '$city', '$zip', '$state', '$phnum', '$TeamName', '$CoachName']";
$resultat = mysql_close($connect); // this is the problematic line
mysql_query($ret); // this line gives an error
echo "Data inserted sucessfully!";
} else {
echo "Inserting data problems!";
}
}
?>