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

    Not being inserted into MySQL Database...

    The form:

    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>
    The action
    PHP Code:
    <?php
    /* Connecting, selecting database */
    $link mysql_connect("localhost""geoffers_w3""************")
    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')" or die (mysql_error());
    echo(
    "Please say this means it's worked");

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

  • #2
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    The error is under mysql_select_db, it should be
    PHP Code:
    mysql_select_db("geoffers_w3",$link) or die("Could not select database"); 


  •  

    Posting Permissions

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