Re: Deleting from MySQL with more than one 'where' variable?
| From: | Richard S. Crawford | Date: | Wed, 21 Nov 2001 20:41:41 +0000 |
| Subject: | Re: Deleting from MySQL with more than one 'where' variable? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75443@lists.php.net to get a copy of this message | ||
What kind of error are you getting?
Your SQL looks fine to me. I can think of a couple of reasons why this might not be working; there may be a difference in how the field names are spelled, or there may not be any rows in usr_stats where the spec column contains a value of $field.
Hm, you might also try:
delete from usr_stats where sel like '$sel' and spec like '$field'At 12:35 PM 11/21/2001, cosmin laslau wrote:
Ok, there's a table with 4 fields, I want to delete from it when two of the variables passed (through the function below) match up with the table's contents. However, I have only been able to get it to work with one 'where' clause, not two. Here's my code for one: function delete_one_sub($sel, $field, $update) { $query = "delete from usr_stats where sel='$sel'"; $result = mysql_db_query("f6", $query); } This was code for two variables: function delete_one_sub($sel, $field, $update) { $query = "delete from usr_stats where sel='$sel' and spec='$field'"; $result = mysql_db_query("f6", $query); } However, that doesn't work. Help? Thanks.Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: underpope@hotmail.com "It is only with the heart that we see rightly; what is essential is invisible to the eye." --Antoine de Saint Exupéry "Push the button, Max!"