Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP manipulating dat retrieved from the DB using php arrays
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


che
manipulating dat retrieved from the DB using php arrays
0 Answer(s)      2 years and 7 months ago
Posted in : PHP


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

Advertisement
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 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
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 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
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
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  
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 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
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
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>
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
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
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 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
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
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
Manipulating attributes
Manipulating attributes       Manipulating attributes You can manipulate two types... attribute Manipulating CSS class attribute You can manipulate
View Photo From Db MySql
View Photo From Db MySql  Good Morning Sir, Please help me, I make a small code but i have a error. I want to make viewer photo from database...(); ResultSet res = stat.executeQuery("select * from kar where nik
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
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
 

 

 

DMCA.com