Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting rows, major confusion

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi all,

I'm using various mysql frontend's mysqlfront/mascon. I have a row delete it, seems to be gone until I refresh, then it comes back.

i.e
DELETE FROM items WHERE item_id=29 AND item_price=10.99 AND item_current=1 AND item_country=2

however using a different identifier works

delete from item where item_manufacturer="sony";

Please help I think I'm going mad
 
Double check the results of your delete before you refresh by checking the DB via the command line.

Are you sure you are adhering to the data definition in your delete?

In this delete:

DELETE FROM items WHERE item_id=29 AND item_price=10.99 AND item_current=1 AND item_country=2

Is item_id a unique row identifier/primary_key?

if so simply delete by the item_id.

it's obvious that all your values are numbers, double check that is how the column types are defined

if one is string type you'll need to put quotes around the value in question in your delete

If this is happening in testing is it happening on the site?

What is the DB query you're using prior to the delete?

In essence you may simply be going around in circles without realizing it.





 
Thanks pete,

Found it's a problem with the float data type, any idea's ?

I can't select a row when using price (float) as an identifier.

select * from items where item_price = 10.99
 
Finally got it.

Float has rounding ability, for currency I should use decimal. Thanks for your reply phpPete, put me on the right track
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top