Note that there are some explanatory texts on larger screens.

plurals
  1. PORegistration Page not Saving Data to Mysql database
    primarykey
    data
    text
    <p>Am having trouble saving data into my db after inserting it from my registration form.</p> <p>Funny enough, only two fields are being saved. i.e., The First and Last Name, but things such as Phone number aren't no matter how hard I try to look for the solution.</p> <p>Below are the files used to connect the Mysql Db with the Registration Form. </p> <p><strong>1. REGISTRATION.PHP</strong></p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;Registration Form&lt;/title&gt; &lt;style type="text/css"&gt; h3 { font-family: Calibri; font-size: 22pt; font-style: normal; font-weight: bold; color: SlateBlue; text-align: center; text-decoration: underline } table { font-family: Calibri; color: white; font-size: 11pt; font-style: normal; text-align:; background-color: SlateBlue; border-collapse: collapse; border: 2px solid navy } table.inner { border: 0px } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form method="post" action="check.php" enctype="multipart/form-data"&gt; &lt;table width="300" border="0" &lt;table align="center" cellpadding="10"&gt; &lt;tr&gt; &lt;td&gt;FirstName:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="FirstName"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;LastName:&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="LastName"&gt;&lt;/td&gt; &lt;tr&gt; &lt;td&gt;Phone:&lt;/td&gt; &lt;td&gt;&lt;input type="double" name="Phone"&gt;&lt;/td&gt; &lt;/tr&gt; &lt;span style="size:10%;color:#FF0000"&gt;&lt;?php if(isset($_GET["pass"])) { echo $_GET["pass"]; } ?&gt;&lt;/span&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;input type="submit" value="Submit" name="registration"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p><strong>2. CHECK.PHP</strong></p> <pre><code>&lt;?php if (isset($_POST['registration'])) { require "connection.php"; $FirstName = strip_tags($_POST['FirstName']); $LastName = strip_tags($_POST['LastName']); $DOB = strip_tags($POST['Phone']); mysql_query(" INSERT INTO users (FirstName, LastName, Phone) VALUES ('$FirstName', '$LastName', '$Phone') ") or die("" . mysql_error()); echo "Successful Registration!"; } ?&gt; </code></pre> <p><strong>3. CONNECTION.PHP</strong></p> <pre><code>&lt;? $name = "root"; $pas = "password"; $dbname = "registration"; $con = mysql_connect("localhost:7077", $name, $pas); mysql_select_db($dbname, $con); ?&gt; </code></pre>
    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.
    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