Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4

Thread: Delete Query

  1. #1
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    I am sure this is right, but i get my die message 'Query Failed' when i execute it, is there any reason why this should fail?
    PHP Code:
        } else if (mode == 'delete') {
            
    $query =  "DELETE FROM `users` WHERE `userid`='$id'";
        }
        
        
    $sql mysql_query($query)
            or die(
    'Query Failed'); 
    I can't figure this out
    JR

  2.  

  3. #2
    Senior Member ajaspers's Avatar
    Join Date
    Apr 2003
    Posts
    149
    Member #
    1150
    You can find out the error by using
    PHP Code:
    $sql mysql_query($query) or die('<pre>' mysql_error() . '</pre>'); 

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Thanks, that is useful

    It says 'Query was empty'
    JR

  5. #4
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    got it, forgot to put in the $ on the mode variable

    i will award you the dollars for helping me to open my eyes
    JR


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 10:26 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com