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 2 of 2
  1. #1
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts

    Parse Error when sending to MySQL database

    My code for the page is:
    PHP Code:
    <?php
    /* Connecting, selecting database */
    $link mysql_connect("localhost""geoffers_****""******")
     ** or die(
    "Could not connect : " mysql_error());
     echo 
    "Connected successfully";
    mysql_select_db("geoffers_w3") or die("Could not select database");
     
     
    $sql "INSERT INTO mapsdownload (name,description,url,validate) VALUES ('$name,'$desc','$url','1')";

    /* Closing connection */
    mysql_close($link);
    ?>
    and the form page is
    Code:
    <form action="newsubmit.php" method="post">
            <label for="name">Name of Map:</label><input name="name" type="text" size="40" />
            <label for="desc">Description of Map:</label> <textarea name="desc" rows="10" cols="40"></textarea>
            <label for="url">URL for download:</label> <input name="url" type="text" size="40" />
            <input name="name" type="submit" value="Submit" /> <input name="name" type="reset" value="Reset" />
          </form>

  • #2
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    Fixed:

    PHP Code:
    <?php
    /* Connecting, selecting database */
    $link mysql_connect("localhost""geoffers_****""********")
    or die(
    "Could not connect : " mysql_error());
    mysql_select_db("geoffers_w3") or die("Could not select database");
     
    $sql "INSERT INTO mapsdownload (name,description,url,validate) VALUES ('$name,'$desc','$url','1')";

    /* Closing connection */
    mysql_close($link);
    ?>


  •  

    Posting Permissions

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