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. Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/ 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'? Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23137 Share on other sites More sharing options...
eranwein Posted April 2, 2006 Author Share Posted April 2, 2006 just did. it doesnt work Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23142 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)? Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23144 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 Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23177 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. Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23230 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 Link to comment https://forums.phpfreaks.com/topic/6392-mysql-problem/#findComment-23411 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.