www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] sql delete problem

  1. #1
    Join Date
    Feb 2006
    Posts
    170

    resolved [RESOLVED] sql delete problem

    why doesnt this work?

    Code:
    <?php
    include "auth_admin.inc.php";
    include "../conn.inc.php";
    
    $quizselected = $_POST["selectedquiz"];
    $qno = $_POST["QNO"];
    
    $sqldelete = "DELETE * FROM $quizselected WHERE QNO = '$qno';";
    
    $sql_result = mysql_query($sqldelete) or die("Couldn't delete from database, please contact your system administrator: $sqldelete - " . mysql_error()); 
    
    
    ?>
    i get the following error

    Couldn't delete from database, please contact your system administrator: DELETE * FROM privatequiz WHERE QNO = 2; - 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 '* FROM privatequiz WHERE QNO = 2' at line 1

    cheers for any help

  2. #2
    Join Date
    Aug 2005
    Location
    The Garden State
    Posts
    5,634
    it should just be:

    Code:
    DELETE FROM your_table WHERE where_conditions;
    no *. You delete rows, you don't delete cells.
    Acceptable Use | SQL Forum FAQ | celery is tasteless | twitter

    celery is tasteless - currently needing some UI time

  3. #3
    Join Date
    Feb 2006
    Posts
    170
    cheers mate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles