Welcome Guest, Not a member yet? Register   Sign In
Generate code to access MySQL records as objects
#1

[eluser]Unknown[/eluser]
Hi All

Can any one suggest me the tool to generate code to access my SQL records as objects?

The generated classes can have getter and setter functions for each table field, functions to insert or update records with the object values, functions to load a record with a given identifier, and delete the object record.




Thanks
Basanth
#2

[eluser]Otemu[/eluser]
Check out http://datamapper.wanwizard.eu/ or http://www.doctrine-project.org/
#3

[eluser]jmadsen[/eluser]
You may be looking for:

http://ellislab.com/codeigniter/user-gui...sults.html

"You can also pass a string to result() which represents a class to instantiate for each result object (note: this class must be loaded)
$query = $this->db->query("SELECT * FROM users;");

foreach ($query->result('User') as $row)
{
echo $row->name; // call attributes
echo $row->reverse_name(); // or methods defined on the 'User' class
} "




Theme © iAndrew 2016 - Forum software by © MyBB