Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't write on Database from Form
    primarykey
    data
    text
    <p>Well I have a problem, but I can't find it. I changed everithing and tried everything different everytime, I ended up with this coded which it looks good but still doesnt work. I would like to know if someone can help me to find it.</p> <p>Here the action of the form:</p> <pre><code> &lt;?php $username = "Test"; $password = "dbpw"; $hostname = "localhost"; //connection to the database $con = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL"; ?&gt; &lt;?php $db_select = mysql_select_db("CS450Game", $con); if(!$db_select){ die("Database selection failed: " . mysql_error()); } ?&gt; &lt;?php $lname = mysql_escape_string($_POST['txt_Lname']); $mi = mysql_escape_string($_POST['txt_MI']); $fname = mysql_escape_string($_POST['txt_Fname']); $month = mysql_escape_string($_POST['lst_dobmonth']); $day = mysql_escape_string($_POST['lst_dobday']); $year = mysql_escape_string($_POST['txt_dobyear']); $address = mysql_escape_string($_POST['txt_address']); $city = mysql_escape_string($_POST['txt_city']); $state = mysql_escape_string($_POST['lst_state']); $zip = mysql_escape_string($_POST['txt_zip']); $hphone = mysql_escape_string($_POST['txt_HPhone']); $cphone = mysql_escape_string($_POST['txt_CPhone']); $email = mysql_escape_string($_POST['txt_email']); $email2 = mysql_escape_string($_POST['txt_email2']); $country = mysql_escape_string($_POST['lst_country']); mysql_query("INSERT INTO `Customer` (`txt_Lname`, `txt_MI`, `txt_Fname`, `lst_dobmonth`, `lst_dobday`, `txt_dobyear`, `txt_address`, `txt_city`, `lst_state`, `txt_zip`, `txt_HPhone`, `txt_CPhone`, `txt_email`, `txt_email2`, `lst_country`) VALUES ('$lname', '$mi', '$fname', '$month', '$day', '$year', '$address', '$city', '$state', '$zip', '$hphone', '$cphone', '$email', '$email2', '$country')"); echo "You info has been submitted"; ?&gt; </code></pre> <p>Thanks in advanced, I tried everything but it doesn't work.</p> <p>My error is that I don't have any error... It works everything fine but just doesn't write on the database!</p> <p>Please help!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload