How to generate data from the database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
heshan
Forum Commoner
Posts: 26
Joined: Tue Jul 13, 2010 1:16 pm

How to generate data from the database

Post 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.
mattbranch12
Forum Newbie
Posts: 18
Joined: Thu Jul 09, 2009 3:14 pm
Location: Hagerstown, MD

Re: How to generate data from the database

Post 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.
heshan
Forum Commoner
Posts: 26
Joined: Tue Jul 13, 2010 1:16 pm

Re: How to generate data from the database

Post 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.
User avatar
arrielmabale
Forum Newbie
Posts: 15
Joined: Fri Aug 13, 2010 3:57 pm
Location: Dubai

Re: How to generate data from the database

Post 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 <

heshan
Forum Commoner
Posts: 26
Joined: Tue Jul 13, 2010 1:16 pm

Re: How to generate data from the database

Post 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.
Post Reply