Re: MySQL Query.....

From: Date: Thu, 19 Jul 2001 03:40:50 +0000
Subject: Re: MySQL Query.....
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-58604@lists.php.net to get a copy of this message
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" <pylem@sympatico.ca> To: <php-general@lists.php.net> 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 <deepndra@icimod.org.np> > To: <php-general@lists.php.net> > 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: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#58604) next »