Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10476

Re: fetching value from related multiple rows & columns in PHP SQL

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: fetching value from related multiple rows & columns in PHP SQL
Date 2013-08-10 08:04 -0400
Organization A noiseless patient Spider
Message-ID <ku5a8r$dlb$1@dont-email.me> (permalink)
References <e066aa3b-8546-4643-a175-8f619f07fe88@googlegroups.com>

Show all headers | View raw


On 8/10/2013 1:50 AM, vikas daiya wrote:
> I have database as follows. using SQL, PHP
>
> Code Period Period2 type amount
> 14     4     2013    TP   500
> 14     5     2013    TP   300
> 14     6     2013    TP   175
> 13     4     2013    TP   150
> 13     5     2013    TP    50
> 13     6     2013    TP   250
> 12     7     2013    TP   110
>
>
> I want to create a form with combos having
>
> which will fetch values as follows.
>
> code > period > period2 > type > amount
>
> 14 > 4 > 2013 > TP > 500
>
> and so on.... same need to be updated / inserted in new table.
>
> note: amount is related to type which is related to period2 which is related to period under code.
>
> means under code "14" there are three values "4,5,6" under this there is one value "2013" (default) and "TP" (default) and amount under this there are values "500,300,175" so when code is sleeted i.e "14" then values 4,5,6 should fetched and then "2013" then "TP" but when period is selected i.e 5 then amount of 5 300 should be fetched.
>
> kindly help me out to solve this query.
>

This isn't a PHP question.  You need to be asking in a SQL newsgroup, 
or, more preferably, a newsgroup related to the database you are using.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

fetching value from related multiple rows & columns in PHP SQL vikas daiya <vikasdaiya@gmail.com> - 2013-08-09 22:50 -0700
  Re: fetching value from related multiple rows & columns in PHP SQL Jerry Stuckle <jstucklex@attglobal.net> - 2013-08-10 08:04 -0400

csiph-web