Problem in Insert Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahia307
    New Member
    • Jun 2007
    • 32

    Problem in Insert Query

    hi
    i have problem in insert query and i cannot understand this probelm. please help me. code is following below.

    $qery = "INSERT INTO tablename(name, email)
    VALUES('$name', '$email')";
    $result_qery = mysql_query($qe ry);
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by rahia307
    hi
    i have problem in insert query and i cannot understand this probelm. please help me. code is following below.

    $qery = "INSERT INTO tablename(name, email)
    VALUES('$name', '$email')";
    $result_qery = mysql_query($qe ry);
    Then you have to execute the query.

    [php]
    if($result_qery ){ //the insert worked
    echo "Successful l";
    } else {
    echo "Unsuccessfull" ;
    }
    [/php]
    Please be more descriptive when asking questions "i have problem" is not going to help us help you.

    Comment

    • stepterr
      New Member
      • Nov 2007
      • 157

      #3
      Is "tablename" your real database table name? Also, PHP and SQL are case sensitive so make sure you are using the same case as what you have in your database table.

      Comment

      Working...