
am querying the DB as follows:
$`result=mysql_query("SELECT name,itemquantity FROM mytable WHERE price='$price'");`
now,i want to create an array to insert the values that are as a result of this query e'g let's say this is the resultant data:
row['names']=john,joel,brian and row['itemquantity']= 10 for john,20 for joel and 1o for brian i want to insert this data into an array then use it.(this is a trading platform),so let's say a user wanted to buy 25 items from the data in the array,and so to achieve this the script has to take the 10 items from john and 15 from joel(that adds up to 25) and then set their items to the remaining value i.e john's items=0 and joel's items=5.how do I code this.please assist. i've tried to simplify this the best i can .thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.