manipulating dat retrieved from the DB using php arrays
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:
name itemquantity price
john 10 100
joel 20 100
brian 10 100
how do I create an array to insert the above data using $name and $quantity as variables;
secondly,(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
View Answers
Ads
Related Tutorials/Questions & Answers:
manipulating dat retrieved from the DB using php arrays
manipulating dat retrieved from the
DB using php arrays am querying the
DB as follows:
$`result=mysql_query("SELECT name,itemquantity
FROM mytable... it.(this is a trading platform),so let's say a user wanted to buy 25 items
from the data
manipulating dat retrieved from the DB using php arrays
manipulating dat retrieved from the
DB using php arrays am querying the
DB as follows:
$`result=mysql_query("SELECT name,itemquantity
FROM mytable... it.(this is a trading platform),so let's say a user wanted to buy 25 items
from the data
Advertisements
manipulating dat retrieved from the DB using php arrays
manipulating dat retrieved from the
DB using php arrays am querying the
DB as follows:
$`result=mysql_query("SELECT name,itemquantity
FROM mytable... it.(this is a trading platform),so let's say a user wanted to buy 25 items
from the data
retrieving info from DB using struts?
retrieving info
from DB using struts? Hi. I was looking info about retrieving info
from a database
using struts.
I need a .java that I suppose connects to a database and show the info on a jsp.
Somebody could help me
combine two arrays in php
combine two
arrays in php combine two
arrays in
php
$newArray = array_combine($diff, $pages_name['data']);
foreach ($newArray as $data) {
var_dump($data);
exit('zzzzz');
echo $data . '<br>
retrive article from sql databse and show using php
retrive article
from sql databse and show
using php hello sir
i have sql database which i store articles.i want to show these article on web page
using php. my field are image,title,summary,content id. plz provide me
displaying data retrieved from a database in a jsp page
displaying data
retrieved from a database in a jsp page the page should display username, emailid, telephone in addition to tthe tagline however... sql = "select billid, customerid, billdate, status
from customerbills where
PHP Tutorials from RoseIndia
PHP Tutorials
from RoseIndia
The detailed
PHP tutorials for beginners and experienced programmers
from
RoseIndia will help you learn
PHP scripting... and other related things like how
to access databases
using PHP etc
Todd oracle DB connection through PHP
Todd oracle
DB connection through PHP Can u please explain how to connect Todd oracle
DB using PHP & What are the setups we need to perform?
Thanks
upload video using php
upload video
using php How to upload a video on MYSQL Server
using PHP Code..? Can any one provide me an example