whats wrong in my insert into statement!!

Discussion in 'PHP' started by jigen7, Oct 8, 2007.

  1. #1
    what is wrong in theses statement?
    $sql = "insert into Links values('URL','Title','Description','Email','SubmitURL','ContactedOn')
    VALUES ('{$arr[0]}','{$arr[1]}','{$arr[2]}','{$arr[3]}','{$arr[4]}','{$arr[7]}')";

    it gives me the error
    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VALUES ('http://www.shinku.com/','http://www.online-store-list.com/','"Www.onlin' at line 2
     
    jigen7, Oct 8, 2007 IP
  2. xemiterx

    xemiterx Peon

    Messages:
    62
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I don't know why this would not work:
    $sql = "INSERT INTO Links (URL, Title, Description, Email, SubmitURL, ContactedOn) VALUES ('{$arr[0]}', '{$arr[1]}', '{$arr[2]}', '{$arr[3]}', '{$arr[4]}', '{$arr[7]}')";
    PHP:
    How you considered whether or not you need to use addslashes() for the data you are inserting into your db?
     
    xemiterx, Oct 8, 2007 IP
  3. jigen7

    jigen7 Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    wahh it works thx hehe it comes from excel data o well
     
    jigen7, Oct 8, 2007 IP