Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2006
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with mysql connection

    I have a form that my users fill out to get my services. The form places whatever the user filled in into a database. I get this error when i try to connect to the database
    Parse error: parse error, unexpected T_STRING in /homepages/0/d176381271/htdocs/kylecaleb/packages/insert.php on line 43

    PHP Code:
    <?php
    $user
    ="username";
    $password="pass";
    $database="databasen";
    $host="localhost";
     
    $first=$_POST['firstname'];
    $last=$_POST['lastname'];
    $email=$_POST['email'];
    $phone=$_POST['phone'];
    $mobile=$_POST['mobile'];
    $address=$_POST['address'];
    $city=$_POST['city'];
    $state=$_POST['state'];
    $zip=$_POST['zip'];
    $package=$_POST['package']
     
    mysql_connect($host,$user,$password) or die( "Unable to connect to database");   <----line 43
    mysql_select_db
    ($database) or die( "Unable to select database");
     
    $query"INSERT INTO contacts VALUES('','$first','$last','$email','$phone','$mobile','$address','$city','$state','$zip','$package')";
    mysql_query($query);
     
    echo(
    "Thank you for signing up. You will recieve an email when your submision is reviewed.");
     
    mysql_close();
    ?>
    I have no clue what it could be. Thanks in advance for any help.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Missing semi-colon

    $package=$_POST['package'];

  • #3
    Registered User
    Join Date
    Apr 2006
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya?

    (who is that????)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •