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 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

View Answers









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
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... 100 how do I create an array to insert the above data using $name
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
that is retrieved from MySQL DB using jsp,jstl,javascript  when click on the next button/link then it must display next 10 record from database and same for previous to display previous 10records. Database Query like this: Select * from table
How to create d db for upload files using bolb i m followin dat upload file in db tutorial
How to create d db for upload files using bolb i m followin dat upload file in db tutorial  Hi, I have tried dis example, I have made d DB luk lik... the message on my browser til dat point.But whn the int s executes the query
How to create d db for upload files using bolb i m followin dat upload file in db tutorial
How to create d db for upload files using bolb i m followin dat upload file in db tutorial  How to create d db for upload files using bolb i m followin dat upload file in db tutorial   Create a table named 'file
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.  Initially,display 7or10 records on a jsp pageand when click on the NEXT button(or href link) then display next 7 records
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
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
How to Retrieve Data from Facebook Using PHP
How to Retrieve Data from Facebook Using PHP  is this link has right content regards that?? http://techpdf.co.cc/blog/how-to-retrieve-data-from-facebook-using-php
how to use String tokenizer on table that is retrieved from database using jsp servlet
how to use String tokenizer on table that is retrieved from database using jsp servlet  Query:Table---- mysql> select pid,medicinename,dose,day,qty from medicinedetails2 where pid=15
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>
How to insert data from a combobox and textbox values into DB using JSP?
How to insert data from a combobox and textbox values into DB using JSP?  hi, How to insert a comb-box and a text box values in to DB using JSP? @DB... and textbox2? into MYSQL DB
Store image from html img tag into mysql db using java
Store image from html img tag into mysql db using java  Hi. How to get the image displayed in the < img > tag of HTML and store it in the mysql database using java? Thanks in advance
Swing JTable which is retrieved from MySQL
Swing JTable which is retrieved from MySQL  How To Display both image and data into Swing JTable which is retrieved from MySQL database
create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword
create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword   create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword
How to get data from DB in to Text box by using Jsp & Ajax
How to get data from DB in to Text box by using Jsp & Ajax   I want to get the data from database in to text box in a jsp page by using Ajax. If I... with a and from that i need to select the required value and i should store
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
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
create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword
create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword   create a web application using java dat accepts 10 relevant tweets frm twitter in real time for dat keyword  
Reading from remote files using PHP,Ubuntu and Windows machine.
Reading from remote files using PHP,Ubuntu and Windows machine.  Hi.... I have a php question. Am working on a script that is suppose to read from... on a windows machine within the same network. After reading from it, the script
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
in registration page,hw the details wil b stored in db,n retrieved.....
in registration page,hw the details wil b stored in db,n retrieved..... ... will b stored in db....(i knw hw to do it bt i ve some doubts in it),so plz give me... in db(do v need to write select query in d same pgm)? and here is my code tthe
how to compare 2 arrays using java?
how to compare 2 arrays using java?  hi can anyone give me the information regarding comparision of arrays.   Java Compare Arrays
How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular expression of php?
How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular expression of php?   How can we extract string 'roseindia.net ' from a string http://deepak@roseindia. net using regular
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
how to display data into textboxes which is retrieved from the database
how to display data into textboxes which is retrieved from the database  I would like to know how to display data into textboxes which is retrieved from database in jsf. could you please provide a small example of how to do
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
How to Append Arrays in PHP
How to append array or merge two arrays in PHP: This PHP tutorial is discussed about different techniques to merge two or more than two arrays e.g. array_merge(), + operator etc. This free php tutorial has small description of print_r
Java using arrays - Java Beginners
Java using arrays  Write a program to input a possibly integer n(n<=10);followed by n real values into an array a of size n and the program must perform the following: Display back the values input Sort the values
how to perform operation on data retrieved from database in jsp?
how to perform operation on data retrieved from database in jsp?  i... entered marks into the database from the jsp page and i can also retrieved data from... on data retrieved from database and the present to the user PLEASE HELP ME TO SOLVE
how to scrape the data from one website another website using html dom parsing in php
how to scrape the data from one website another website using html dom parsing in php  " how to scrape the data from one website another website using html dom parsing in php" i'm trying this one .please provide code for me
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... document) using this tutorial   PHP displaying the time and date into your
php download file from ftp
php download file from ftp  Need to download files from ftp using php. a simple example
php download file from url
php download file from url  how to download multiple files in PHP using the URL's
PHP list box mysql
PHP List box that displays the data from mysql table. User can select any value from the PHP list box. Example of PHP MYSQL List Box Code <..._db($database, $chandle) or die ("Database not found."); $query1="select * from
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
fat image from db
fat image from db   <%@ page import="java.sql.*"%> <%@ page import="java.io.*"%> <% Blob image = null... = stmt.executeQuery("select image from regimg where id ='45'"); if (rs.next
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
arrays
arrays  using arrays in methods   Java use arrays in methods import java.util.*; class ArrayExample{ public static int getMaxValue(int[] arr){ int maxValue = arr[0]; for(int i=1;i < arr.length;i
Storing Data (Retrieved from a XML Document) to a File
Storing Data (Retrieved from a XML Document) to a File... to store data (retrieved from the XML document) to a specified file (with ... for generating the text retrieved from the xml document.  An object
Error using SoapClient() in PHP
Error using SoapClient() in PHP  I'm trying to access WSDL(Web Service Definition Language) file using SoapClient() of PHP. I found that WSDL file... using: $client = new SoapClient("https://webservices.chargepointportal.net
PHP Variables from Page to Page
PHP Variables from Page to Page A PHP programmer can easily pass the variables from one page to another page by using different method and functions provided...[] function in php is used to take the information from one page to another page
Arrays
Arrays   Hi I need help with the following exercises. Exercise 1: Write a Java application in which the user is prompted for the total number... initialize an array with 10 String values. Randomly select a value from the array
PHP Sorting Arrays Tutorial
PHP Sorting Arrays      ...(): This function of PHP sorts an array using "natural order" algorithm... will learn how to sort an array using key as well as value. Sort By Value:ADS
remove comma from string php
remove comma from string php  How to remove the last comma from the string in PHP

Ads