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

 
 


che
manipulating dat retrieved from the DB using php arrays
0 Answer(s)      a year and 2 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
View Answers









Related Pages:
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
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
Manipulating attributes
Manipulating attributes       Manipulating attributes You can manipulate two types... attribute Manipulating CSS class attribute You can manipulate
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
Arrays
as well. Read a set of 10 correct answers,using a JOptionPane dialog box and store... the letters and the user may enter capital or small letters. Extract each letter from... of the number of answers from the student's record that match the answers
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
Arrays
++, which had a good reason for using zero (pointer arithmetic on arrays... to do the sum, which frees you from using an index if you simply need to get...];. Library methods for arrays Static methods for manipulating arrays
Comparing Arrays
initializes two arrays and input five number from user through the keyboard... or not. This comparison operation is performed by using the equals() method of Arrays... for manipulating arrays. Here is the code of the program: import 
PHP Sorting Arrays Tutorial
PHP Sorting Arrays      ... will learn how to sort an array using key as well as value. Sort By Value: PHP provides...)  natsort(): This function of PHP sorts an array using "natural
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
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
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
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
db
* from producttest"; rs = statement.executeQuery(QueryString);%> <
db
* from producttest"; rs = statement.executeQuery(QueryString);%> <
arrays
arrays  Write a program to print details of all the months with number of days in a year (Leap or Non Leap year) using array of objects Integer and String
arrays
will helpful for you. The sample code given below is for removing the elements from... 3rd position element from original array System.arraycopy(num, 0... after removing 3rd " + "position \n element from the original array
arrays
arrays  public class Country{ string countryName; string location; int population; double area; } a.write a java statement to create an array of 10 country objects called mycountry using the Country class. b.Assuming
arrays
from the user and display distinct words in ascending order. The code also
arrays
from the user and display distinct words in ascending order. The code also
arrays
from the user and display distinct words in ascending order. The code also
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
PHP Arrays
be easily accessed. There are three kinds of arrays in PHP: Numeric array... we can write this example using ID keyslike this:  <?php $marks... containing one or more arrays 3.7.1. Numeric Arrays A numeric array stores
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
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
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
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
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
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
Zend Db error - WebSevices
Zend Db error  Hello friends, How i get the values from the database using zend framework Any one know the code. Help me
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
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
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  
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
how to insert, retrieve data from,to db(code)....
that data will b stored in db(m using sybase). 2.also hw to retrieve the data from db. cn u plz tel me the code in detail.n i thk it shud b written in jdbc...how to insert, retrieve data from,to db(code)....  Hi..... i ve
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
upload csv to mysql db using jsp upload
upload csv to mysql db using jsp upload  Hello all, Please give me the code to uplad .csv from jsp page and insert values into MySQl db. I have a table with 8 cloumns.(MDN--varchar(30),Otafdate date,crt varchar(30),dmdn
how to insert, retrieve data from,to db(code)....
will b stored in db(m using sybase). 2.also hw to retrieve the data from db. cn u...how to insert, retrieve data from,to db(code)....  Hi, i have created... for username, password using javascript,hw to write that,n in wch pgm i ve to write(i
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>
Sitemap PHP Tutorial
| PHP Flood Protection using session | PHP Sorting Arrays | PHP Create a Shout box using MySQL. | PHP MySQL Connect to a Database | php MySQL order... by PHP  | PHP Ajax | PHP SimpleXML | PHP Ajax DB PHP Tutorial Section
JSP,DB,SERVLET
JSP,DB,SERVLET  hi thank you for your reply.With this code i can... the code for the same scenario using for populating data into database through... * from data where name='"+name+"'"); while(rs.next()) { data =":"+Integer.toString
JSP,DB,SERVLET
JSP,DB,SERVLET  I have a jsp page called page1.jsp with 3 text fields... should be automatically populated from database through servlet... not populate the datas automatically from databse in jsp on entering name ...can u
Arrays, loops and string handling
Arrays, loops and string handling  How would i go about in creating... correct answers using JOptionPane dialog box and store the entire answer as on string... capital or small letters. Extract each letter from this string and fill
retrieve value from db in text box + calendar implementation.
retrieve value from db in text box + calendar implementation.  I have used http://www.roseindia.net/javascript/javascript-calendar.shtml code... there is already a text box..Now i want to get the value retrieved from database
php
php  plz tell me code for PHP SQL Insert,delete,update,view is used to insert the record from HTML page to Mysql database using in single PHP form
javascript variable value insertion in DB
javascript variable value insertion in DB  how can I insert javascript variable value into database using php

Ask Questions?

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.