delete statement not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    delete statement not working

    hi all
    i have a loop that decides if a row should be deleted. i know i am getting into my if statement and that the variable that stores the id is correct but the delete statement wont work can someone look and see what dumb mistake i made

    [PHP]
    $a=mysql_query( "DELETE FROM 'calendar' WHERE 'id'='$row2[0]'");
    [/PHP]

    i know that $row2[0] = the id cause i have an echo statement under that but for some reason my stuff never gets deleted from the database

    eric
  • tolkienarda
    Contributor
    • Dec 2006
    • 316

    #2
    Originally posted by tolkienarda
    hi all
    i have a loop that decides if a row should be deleted. i know i am getting into my if statement and that the variable that stores the id is correct but the delete statement wont work can someone look and see what dumb mistake i made

    [PHP]
    $a=mysql_query( "DELETE FROM 'calendar' WHERE 'id'='$row2[0]'");
    [/PHP]

    i know that $row2[0] = the id cause i have an echo statement under that but for some reason my stuff never gets deleted from the database

    eric

    my bad i needed to take the quotes out around calendar

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      You don't need the quotes around the id column either.

      Comment

      • tolkienarda
        Contributor
        • Dec 2006
        • 316

        #4
        ok thanks

        eric

        Comment

        Working...