Jump to content

[SOLVED] Will not write into Database:


mikelmao

Recommended Posts

My query doesnt save into the DB.. here it is:

 

                   <?php include 'connect.php';
                    if($_SERVER['REQUEST_METHOD'] == 'POST')
                    {
                      if($_POST['fname'] == "" || $_POST['lname'] == "" || $_POST['uname'] == "" || $_POST['pass'] == "" || $_POST['pass2'] == "" || $_POST['mail'] == "" || $_POST['birth'] == "")
                      {
                        echo "Please fill in all the fields before continuing";
                        echo "<meta http-equiv=Refresh content=2;url='order.php'>";
                      }
                      elseif($_POST['pass'] != $_POST['pass2'])
                      {
                        echo "The 2 passwords do not match";
                        echo "<meta http-equiv=Refresh content=2;url='order.php'>";
                      }
                    else
                    {
                    mysql_query("INSERT INTO order (fname, lname, uname, pass, mail, birth, plan, time) VALUES ('" . $_POST['fname'] . "', '" . $_POST['lname'] . "', '" . $_POST['uname'] . "', '" . $_POST['pass'] . "', '" . $_POST['mail'] . "', '" . $_POST['birth'] . "', '" . $_POST['plan'] . "', '" . $_POST['time'] . "')");
                    echo "Thank you for ordering at CXHosting, We will review your application within 48 Hours. You will recieve an email when your application has been aproved";
                    }
                    }
?>

Connect.php=

<?php
$con = mysql_connect('localhost','****','*****');  
if (!$con)
  {
    echo "Connot connect.";
  }
mysql_select_db('***********' ,$con);
?>

it all exists.. I dont get any MYSQL Errors.... Please help.. thanks :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.