SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation i cant get the data to my database!!

    <?php
    $db_host = "localhost";
    $db_username = "root";
    $db_pass = "";
    $db_name = "name";

    @mysql_connect("$db_host","$db_username","$db_pass") or die ("kommer inte åt mysql");
    @mysql_select_db("$db_name") or die ("kommer inte åt databas");

    if ( isset($_post['förnamn'], $_post['efternamn'], $_post['ålder']))

    msql_query("INSERT INTO `tommy` SET
    `förnamn` = '{$_post['förnamn']}',
    `efternamn` = '{$_post['efternamn']}',
    `ålder` = '{$_post['ålder']}'")


    ?>
    <html>
    <body>
    <form action="" method="get">
    <input type="text" value="förnaman" name="förnamn" id="" /> <br />
    <input type="text" value="efternamn" name="efternamnbre" id="" /> <br />
    <input type="text" value="ålder" id="" name="ålderjoe" /> <br />
    <input type="submit" value="post"/>
    </form>
    </body>
    </html>


    i cant get the data to come to my database.
    i now that user, password, host, name database tommy, förnamn ,efternamn, ålder. are correct!!!

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,017
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    you wrote msql_query

    shouldn't it be mysql_query?
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Member
    Join Date
    May 2011
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    allways some &&&euro;%##%%$ missspelllling!?!?


Bookmarks

Posting Permissions

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