Current location: Hot Scripts Forums » Programming Languages » PHP » PHP MySQL Scripting Issue


PHP MySQL Scripting Issue

Reply
  #1 (permalink)  
Old 12-13-05, 08:57 AM
Rattlecage Demon's Avatar
Rattlecage Demon Rattlecage Demon is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
PHP MySQL Scripting Issue

$queryvariable = "delete from DATABASE.TABLE where (FIELDNAME='$SOMEVARIABLE' or OTHERFIELDNAME='$SOMEVARIABLE');";
MYSQL_QUERY($queryvariable);

This query works when put into PHPMyAdmin but not when the script is run. Any ideas why? Thanks.

Names have been changed for posting reasons.
__________________
AIM: Rattlecage Demon
Reply With Quote
  #2 (permalink)  
Old 12-13-05, 09:22 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
Quote:
Originally Posted by Rattlecage Demon
Names have been changed for posting reasons.
Like that would present any security issue to your sight of whose location and login credentials we have absolutely no idea...

Remove the first semi-colon on the query line, between the last parenthesis and last doube quote.
PHP Code:

$queryvariable "delete from DATABASE.TABLE where (FIELDNAME='$SOMEVARIABLE' or OTHERFIELDNAME='$SOMEVARIABLE')"
Reply With Quote
  #3 (permalink)  
Old 12-13-05, 09:50 AM
Rattlecage Demon's Avatar
Rattlecage Demon Rattlecage Demon is offline
Newbie Coder
 
Join Date: Oct 2005
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Angry

Thanks for the smarm and wrong answer.
__________________
AIM: Rattlecage Demon
Reply With Quote
  #4 (permalink)  
Old 12-13-05, 10:37 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts


Oh yeah:
PHP Code:

$queryvariable "delete FIELDNAME from DATABASE.TABLE where FIELDNAME='$SOMEVARIABLE' or OTHERFIELDNAME='$SOMEVARIABLE'"
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
IIS MYSQL and PHP nommiiss PHP 6 01-31-06 04:30 PM
WEB HOSTING - $4.99/MONTH For 1GB HD & 25GB BW! CPanel, PHP, MySQL & MORE! IncognitoNet General Advertisements 0 11-24-05 06:18 AM
RESELLER WEB HOSTING - $9.99/MONTH For 4GB HD & 30GB BW! CPanel, PHP, MySQL & MORE! IncognitoNet General Advertisements 0 09-29-05 07:30 AM
PHP multi-dimensional array sorting issue aqw PHP 2 06-24-05 11:09 PM


All times are GMT -5. The time now is 06:23 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.