populate a form with info from database

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
izzysanime

populate a form with info from database

Post 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
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: populate a form with info from database

Post 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.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
izzysanime

Re: populate a form with info from database

Post 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
Kayin
Forum Members
Forum Members
Posts: 59
Joined: Mon Jun 05, 2006 2:33 am

Re: populate a form with info from database

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

Re: populate a form with info from database

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

Re: populate a form with info from database

Post by izzysanime »

never mind, i got it
Post Reply

Return to “The Lounge”