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 arraysmanipulating 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 arraysmanipulating 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 arraysmanipulating 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 phpcombine 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 phpretrive 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 pagedisplaying 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 Append Arrays in PHPHow 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 BeginnersJava
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
PHP Tutorials from RoseIndiaPHP 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 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 phpupload video
using php How to upload a video on MYSQL Server
using PHP Code..? Can any one provide me an example
arraysarrays
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
Error using SoapClient() in PHPError
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 PagePHP 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