eranwein Posted April 2, 2006 Share Posted April 2, 2006 i have two tables: tblItem and tblItemColor.i want to delete some records from the tblItemByColor table.this is the query i'm trying:DELETE FROM mydb.tblItemByColor WHERE item_number = 10 AND (color_number = 6 OR color_number = 9)no rows are effected by running it, although there are records with those properties. Quote Link to comment Share on other sites More sharing options...
Desdinova Posted April 2, 2006 Share Posted April 2, 2006 did you try putting the numbers between quotes? ie WHERE col = '10'? Quote Link to comment Share on other sites More sharing options...
eranwein Posted April 2, 2006 Author Share Posted April 2, 2006 just did. it doesnt work Quote Link to comment Share on other sites More sharing options...
Desdinova Posted April 2, 2006 Share Posted April 2, 2006 are you sure every item is spelled the right way (mind caps and all)? Quote Link to comment Share on other sites More sharing options...
shortj75 Posted April 2, 2006 Share Posted April 2, 2006 try it like this[code]DELETE FROM tblItemByColor WHERE item_number = 10 AND (color_number = 6 OR color_number = 9)[/code]you dont need to call your db (mydb.) it is already being called from your mysql_connect page Quote Link to comment Share on other sites More sharing options...
eranwein Posted April 2, 2006 Author Share Posted April 2, 2006 i have in my project something like 300 querys. all built with "mydb.", so i'm guessing this is not the reason...btw, whenever i forgot to call "mydb." it failed to run. Quote Link to comment Share on other sites More sharing options...
shortj75 Posted April 3, 2006 Share Posted April 3, 2006 do you have it in a query[code]mysql_query("DELETE FROM mydb.tblItemByColor WHERE item_number = 10 AND (color_number = 6 OR color_number = 9))or die(mysql_error());[/code]if so add the [or die(mysql_error())] that should tell you the problem Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.