Page 1 of 1
populate a form with info from database
Posted: Mon May 07, 2007 8:02 pm
by izzysanime
Hi,
Does anyone have any suggestions/ links for tutorials on how to take specific fields in a database and make them populate form fields. I would also need a way to enter an ID for a table row from a database and that would be what is placed in the fields. Also, I can pay someone to make it for me if there is no easy way.
Thanks
Josh
Re: populate a form with info from database
Posted: Mon May 07, 2007 8:07 pm
by calguy1000
You don't mention if there's a pre-existing database (I assume so), and you also don't mention what you want to do with the form (update records in the database, send an email, I'm not sure).
The formbuilder module allows you to create a form and store the results in the database, and the formbrowser module allows you to browse through those database records.... if it's not an existing database, this may help you.
If it doesn't PM me.
Re: populate a form with info from database
Posted: Mon May 07, 2007 8:32 pm
by izzysanime
Their will be an existing database. Im using another open source tool called formtools. It does not have to be part of it. I just want to grab the specific info from the DB and put it into a form, an id number would need to be entered into a field, then when the user (client) clicks next, it will make a form that will show only specific parts of the record. THe reason why I want it to create the record into a form is because that would then be sent to another database table. (this is all the clients choice, not mine ^_^) Does that help at all? It would be for an invoice, the client enters an id number and then it only takes the address, name from the DB and fills it in.
Thanks,
Josh
Re: populate a form with info from database
Posted: Mon May 07, 2007 9:36 pm
by Kayin
input fields have the "value" attribute, use that.
Essentially what you do is query the database and pull the information you want out of there, whether that be a name, id, or a description of the table..
then in your HTML code, " />
That's the general idea. Actual implementation gets a little more complicated than that though, especially if u have select boxes.
w3schools.com has a great html reference. php.net has a wonderful php reference, and wouldn't u know, mysql.com has a beautiful mysql reference

.
-K
Re: populate a form with info from database
Posted: Tue May 08, 2007 12:44 am
by izzysanime
I was using a tutorial, I got this error
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /mounted-storage/home8/sub002/sc15160-KJJA/www/clients/fs/invoice_form.php on line 7
Re: populate a form with info from database
Posted: Tue May 08, 2007 1:06 am
by izzysanime
never mind, i got it