[Help] Populate Form After Chosing A Value From Db

I there, iam trying to populate a form when chosing a value from a dropdownlist.

For example:

I have a database called client with id name phone number and address, want to retrive those values to another table after chosing in the form from a dropdownlist the name of the client.

In the invoice i have the client_id field with relation to the client_id on the client table, i have made this funtion to retrive the values from the client db.

What could i do to result in what i want?

I’am sorry if my explanation its a bit confused, english its not my native language.

Thanks in advance.

[color="#006400"]/* moved from Tips, Snippets forum */[/color]