MySQL Forums
Forum List  »  PHP

Select not returning rows
Posted by: Bryan Wood
Date: September 12, 2005 11:32PM

I have a fragment of code that I am trying to check something in my database that is not returning the correct select value.

I have a form that displays data from the database that will be updated. If the user doesnt change anything then the "UPDATE" statement obviously returns a 0 rows effected.

UPDATE
rcpt_item
SET
itm_name='%s', value='%s', taxable='%s', qnty='%s', cat_id='%s'
WHERE
ri_id='%s'

I wrapped the update function with another that selected out the specific item. I wanted to insure that nothing was changed hence the reason I put them all in the "WHERE" clause. because obviously if nothing has changed from the form then it must be that way in the database.

SELECT
ri_id
FROM
rcpt_item
WHERE
itm_name='%s' AND
value='%s' AND
taxable='%s' AND
qnty='%s' AND
cat_id='%s' AND
ri_id='%s'

However, this select doesnt return any rows even though all the content that is being queried came from the database.

Is there a PHP function or perhaps a piece of SQL that I am over looking that would help me with this or am I stuck finding a way to validate all the content individually since that seems to work but is way too slow for what is going on with this process.

~itanex

Options: ReplyQuote


Subject
Written By
Posted
Select not returning rows
September 12, 2005 11:32PM
September 13, 2005 03:07AM
September 13, 2005 01:02PM
September 13, 2005 01:05PM
September 13, 2005 01:30PM
September 13, 2005 02:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.