hmvrulz Posted October 16, 2008 Share Posted October 16, 2008 Can some one provide a database handler class that can Connect to db query select table result in an array give number of rows disconnect Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/ Share on other sites More sharing options...
Dathremar Posted October 16, 2008 Share Posted October 16, 2008 this one is nice for MySQL: [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/#findComment-666879 Share on other sites More sharing options...
hmvrulz Posted October 16, 2008 Author Share Posted October 16, 2008 this one is nice for MySQL: seems to be nice... can u provide me with examples to use it.. am new to OOP Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/#findComment-666887 Share on other sites More sharing options...
RichardRotterdam Posted October 16, 2008 Share Posted October 16, 2008 PDO maybe? its comes as part of php since version 5 Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/#findComment-666901 Share on other sites More sharing options...
Dathremar Posted October 16, 2008 Share Posted October 16, 2008 this is how u make object of that class: // connection to database class name_of_object extends DB_Sql { var $classname = "name"; var $Host = "host"; var $Database = "database_name"; var $User = "user_name"; var $Password = "password"; function haltmsg($msg) { echo "Database error:\\t".$msg."\\nPHP reported:\\t".$this->Error; exit; } } After this use: $name_of_instance_of_object = new name_of_object; and after this use : $name_of_instance_of_object->query($query_string); -> for executing queries $name_of_instance_of_object->next_record(); -> for geting the next record $name_of_instance_of_object->nr(); -> number of rows for the result of the execution of the query. These are most common used i guess. If u need more hlp just post here. Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/#findComment-666907 Share on other sites More sharing options...
hmvrulz Posted October 16, 2008 Author Share Posted October 16, 2008 thanx... in case i need help i wil surely knock the door Link to comment https://forums.phpfreaks.com/topic/128676-need-a-sinple-database-handler-class/#findComment-666915 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.