Page 1 of 1

How to generate data from the database

Posted: Wed Aug 11, 2010 11:02 am
by heshan
Hi all,

This is something related with php as well as java script. If anyone can help me regarding this issue i would be very pleased.

In a particular form, i have 2 fields namely customer id and Account type. Since there are many account types it is stored as a jump menu.

There are seperate tables in my database to represent each of those accounts types. There is a seperate field in each table called account number which is auto incremented.

If i select a particular account type in my form, i want to get the account number which is relevant to that account type. For an example if i click the submit button a message should appear like
" A new ..........( relevant account type) has been successfully opened"

Any idea of how this could be done?

Thanks,
Heshan.

Re: How to generate data from the database

Posted: Wed Aug 11, 2010 11:07 am
by mattbranch12
You may want to use AJAX for this. Also could you give a better description of your tables and post what you have for you script thus far.

Re: How to generate data from the database

Posted: Fri Aug 13, 2010 12:54 pm
by heshan
There are 6 tables regarding this issue.

abhimani_plus, shakthi, surathal etc ( All are Account types)

Each of the table following fields included.
Ex: abhimani_plus (ap_number,ap_interest,ap_balance, account_type)

When i select particular account type in my form, seperate tables should provide necessary information.

I have no idea about Ajax. Can't it possible to do with only PHP and MySQL. I have to do it very urgently.
Hope you will help me out......

Thanks,
Heshan.

Re: How to generate data from the database

Posted: Sat Aug 14, 2010 2:37 am
by arrielmabale
Serialize your data in the jump menu then parse it when you need it

Code: Select all


value=id_on:id_two:id_tree" > Account Type <


Re: How to generate data from the database

Posted: Mon Aug 16, 2010 2:41 am
by heshan
Hi,

My jump menu code is looking like this,

Code: Select all

[syntax=php]
<td width="55%" align="left" bgcolor="#FFFFFF" class="attribute1"><select name="account_type" id="jumpMenu" >
          <option>Savings Investment</option>
          <option>Surathal</option>
          <option>Shakthi</option>
          <option>Abhimani Plus</option>
          <option>Yasasa</option>
          <option>Fixed Deposit</option>
        </select></td>
        <td width="10%">&nbsp;</td>

[/syntax]

How this could be changed??

I would also like to know how to serialize data?
since i am a new to php i have no idea about serialization.

I want your help...

Thanks,
Heshan.