using INSERT into construct to add data into a table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pattie
    New Member
    • Jul 2007
    • 1

    using INSERT into construct to add data into a table

    I hava been trying to add data into a table using INSERT into unsuccessfully. Doing it manually works,and all other constructs works like SELECT,UPDATE.S o what might be a cause.


    My syntax

    $query= INSERT into table Product("prod_n ame","prod_ID", "descriptio n")
    VALUES('sony',' s12','Mega pixels');


    P'se help me coz it is ril disturbing me.....
  • mwasif
    Recognized Expert Contributor
    • Jul 2006
    • 802

    #2
    Do not use quotes around column names. The correct syntax is

    [PHP]$query= "INSERT into table Product(prod_na me,prod_ID,desc ription)
    VALUES('sony',' s12','Mega pixels')";[/PHP]

    Comment

    • kovik
      Recognized Expert Top Contributor
      • Jun 2007
      • 1044

      #3
      Yeah, it's always a goo idea to practice your SQL either on a database or (if you must) in phpMyAdmin.

      Comment

      Working...