creating rows in mysql with data

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default creating rows in mysql with data

    Hi i have two files

    <HTML>
    <BODY>
    <form method="post" action="datain.php">
    First name:<input type="Text" name="first"><br>
    Last name:<input type="Text" name="last"><br>
    Nick Name:<input type="Text" name="nickname"><br>
    E-mail:<input type="Text" name="email"><br>
    Salary:<input type="Text" name="salary"><br>
    <input type="Submit" name="submit" value="Enter information">
    </form>
    </HTML>
    and
    <HTML>
    <?php
    $db = mysql_connect("localhost", "root","");
    mysql_select_db("learndb",$db);
    $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
    VALUES ('$first','$last','$nickname','$email','$salary')" ;
    $result = mysql_query($sql);
    echo "Thank you! Information entered.\n";
    ?>
    </HTML>
    this creates empty rows and nothing else. the data i enter in the form isnt
    being used. can someone help? Im running phpdev v423.

    Thanks



    The Voigts Guest

  2. Similar Questions and Discussions

    1. extension for creating professional charts based on mysql data?
      Hi all, is there an extension for dreamweaver 8 to make professional Charts (line)? I'm using Dymanic Flash Chart but it lach an important...
    2. creating unique rows
      Hi. I know how to do this in a script, but i'm trying to use DB commands to do my data aquisition and creation. Here's what i'm trying to do. I...
    3. working RSS code - creating using mysql data ??
      I already have my news page pulled from mysql I am hoping to have a dynamically generated rss scrtipt, I've tried downloaing a few and modifying...
    4. are there any guides to creating a dynamic menu from mysql data?
      I'd like to create a menu system thats dynamic in nature and pulls the page id ,name, title etc from a mysql table so that when a page is added it...
    5. Help in creating data entry forms with MySQL
      Hi, I was wondering if any of you experts has some example of MySQL data entry form either using PHP or any public domain software for my photo...
  3. #2

    Default Re: creating rows in mysql with data

    The Voigts a écrit le 29/01/2004 :
    [...]
    > $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
    > VALUES ('$first','$last','$nickname','$email','$salary')" ;
    [...]
    > this creates empty rows and nothing else. the data i enter in the form isnt
    > being used. can someone help? Im running phpdev v423.
    Try using $_POST['var'] instead of $var :

    $sql = "INSERT INTO personnel (firstname, lastname, nick, email,
    salary) "
    ."VALUES
    ('".$_POST['first']."','".$_POST['last']."','".$_POST['nickname']."','".$_POST['email']."','".$_POST['salary']."')";


    Jedi121 Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139