Jump to content
Sign in to follow this  
farse

Script works only on first row of query result

Recommended Posts

This code is excerpted from a larger form for editing values saved in the database. It was written by someone else who is no longer available and I am stymied by its behavior. The conditions are: artPrice can be any integer; the query returns more than one row and all three “allow" functions return true. As indicated, artPrice = 0 means not for sale; artPrice = 1 means price on request and all other values represent dollar values.

For the first row returned, expected behavior occurs. A price can be changed in value or  changed to POR or NFS; POR can be changed to NFS and vice versa and either one can be changed to a dollar value.

For all rows other than the first, a dollar price can be changed to a different value or it can be changed to POR or NFS. POR can be changed to NFS and vice versa. The problem is that POR or NFS, whether set from the database or by a change from a dollar value, cannot be reset to a dollar value.

It took me a few hours just to figure out the parameters of the problem and lots more to decide I couldn’t solve it.

Anybody?

price_edit.php

Edited by farse
typo

Share this post


Link to post
Share on other sites

It sounds like one of your functions isn't working right, but you didn't show the code for those functions.  It's best to just copy and paste your code into a code block here in the forum.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...