Solved my problem by
- SELECT AccountHead FROM cash
- stored the result in $acchead in PHP code
- UPDATE $acchead SET ........................................
----- Original Message -----
From: "Deependra B. Tandukar" <[EMAIL PROTECTED]>
To: "py_sympatico" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, July 19, 2001 09:25
Subject: Re: [PHP] MySQL Query.....
> Thanks but it is not working!
>
> My problem goes like this:
> Frankly speaking I am trying to make web based accounting package for my
> organization.
>
> I have talbes:
> Voucher
> Sales
> Cash
> Bank
> Income
> Expenses, etc.
>
> All are of the follwoing structure
> VN Date AccountHead AccountType Dr Cr
> Remarks
>
> Suppose there is a entry like in Voucher
> 101 2001-07-18 Sales FixedAsset 0 5000
> Monitor sold
> 101 2001-07-18 Cash CurrentAsset 5000 0
> Monitor sold
>
> In Sales
> 101 2001-07-18 Cash CurrentAsset 5000 0
> Monitor sold
>
> In Cash
> 101 2001-07-18 Sales FixedAssets 0 5000
> Monitor sold
>
> Now if I have to have Bank in place of Cash with VN=101, I simply go and
> change in Voucher HTML form and press "Submit button", it takes effect in
> all the required tables except in Sales (the entry should chage from Cash
to
> Bank in this case). ( for you info I am using
> <form>
> while ($row=mysql_fetch_array($query)) {
> $VN=$row["VN"];
> $Date=$row["Date"];
> $AH=$row["AccountHead"];
> $AT=$row["AccountType"];
> $Dr=$row["Dr"];
> $Cr=$row["Cr"];
> $Remarks=$row["Remarks"];
> echo "
> <table>
> <tr><td><input type=text value=$item name=item>
> </td>
> </tr>
> </table>";
> };
> </form>
> I am trying to select Sales table from TableCash.AccountHead. In fact I am
> trying to select an AccountHead from Cash where VN=101 and converting the
> AccountHead into Table name. In HTML, both the AccountHead are named as AH
>
> So is there any way that converts selected Cash.Sales from (Table)Cash
into
> (Table)Sales? I did something like "Update $AH.AccountHead (AccountHead)
> values ($AH)";
>
> By doing this the error I get is "Bank.Sales" table not exist.
>
> Looking forward to hearing from you.
>
> Warm Regards,
> DT
> ----- Original Message -----
> From: "py_sympatico" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 10:10
> Subject: Re: [PHP] MySQL Query.....
>
>
> > Try,
> > "select '$TableItem'.list where id = 1";
> >
> > py
> >
> > ----- Original Message -----
> > From: Deependra B. Tandukar <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 18, 2001 12:14 AM
> > Subject: [PHP] MySQL Query.....
> >
> >
> > > Greetings !
> > >
> > > I have following tables in MySQL:
> > >
> > > TableItem
> > > id list
> > > 1 Banana
> > > 2 Orange
> > > 3 Mango
> > >
> > > Other tables are:
> > > Banana, Orange, Mango
> > >
> > > Instead of selecting Table Banana directly I need to select it as
> "select
> > > $TableItem.list where id=1" or something like that for editing or
> deleting
> > > items in Table Banana . I tried to do like this but doesn't work. Does
> it
> > > work somehow?
> > >
> > > Looking forward to hearing from you.
> > >
> > > Warm Regards,
> > > DT
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]