oslo Posted February 5, 2013 Report Share Posted February 5, 2013 hi all, i get a class person (get set), create an object (eg person=new person(). my problem is how to use get()-function to get values from a form and insert in db thank you. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted February 5, 2013 Report Share Posted February 5, 2013 Those are two separate things. The "class person" is an example of object oriented programming (OOP) -- it's a design pattern, and can be used as an organizational structure to create an object that retrieves information from a form and processes it... but in and of itself, OOP can't do what you are after. To retrieve data from a form, you'd need to use $_POST[] and to send it to the database, you'd need to use a connection to a database (MySQL, MySQLi or PDO) and an SQL "insert" command. I wrote an example application that adds/deletes and edits data from a database. Might be worth checking out to help you get started? http://www.killersites.com/community/index.php?/topic/3064-basic-php-system-view-edit-add-delete-records-with-mysqli/ Quote Link to comment Share on other sites More sharing options...
oslo Posted February 5, 2013 Author Report Share Posted February 5, 2013 thanks a lot. it is very helpful! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.