help with sql line?

Discussion in 'PHP' started by cornetofreak, Jul 20, 2008.

  1. #1
    Whats wrong with this sql line?

    mysql_query("INSERT INTO data (id,title,post) VALUES (NULL, $preg_title,$preg_matchedslash)") or die(mysql_errno());
    
    PHP:
     
    cornetofreak, Jul 20, 2008 IP
  2. thumbnailspro

    thumbnailspro Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try the following below, values ('', will be inserted as mysql id if that is what your attempting?

    hope it helps!

    
    
    mysql_query("INSERT INTO data ( id , title , post ) VALUES ('', '".$preg_title."', '".$preg_matchedslash."' )") or die(mysql_errno());
    
    
    PHP:
     
    thumbnailspro, Jul 20, 2008 IP
  3. cornetofreak

    cornetofreak Peon

    Messages:
    170
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    godsend man i thought id tried that my bad

    $rep = $rep++;

    safe man
     
    cornetofreak, Jul 20, 2008 IP
  4. thumbnailspro

    thumbnailspro Peon

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    your welcome... glad i can help! :)
     
    thumbnailspro, Jul 20, 2008 IP