I tell you, I'm having a hell of a time finding a database class that is compatible with php4 and php5. I'm looking for something simple and lightweight. If you have one or can point me in the direction of one, I'd be very grateful.
I use Adodb for almost everything. It is not very lightweight but if you do a lot of database stuff it will speed up development. It has an abstraction layer so you can use it with all major databases (MySQL, PostGreSQL, Oracle, etc. etc.)
Thanks for the link, but I think ADOdb and ADOdblite are both more than I need. I don't have a use for an abstraction layer and after looking through their documentation it seems like they're over complicating things. At least for my needs anyway. Thank you though. I've bookmarked it as I think I might use it in the future.
I have a simple database class I use, its good for simply executing queries, retrieving results as either arrays or objects, and counts number of rows. PM if you are interested.
Just use the inbuilt db functions, they are clean and lightweight, classes just gives you more headaches as you have to include it in the files you want to use them. What is wrong with this? <?php // Connecting, selecting database $link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password') or die('Could not connect: ' . mysql_error()); echo 'Connected successfully'; mysql_select_db('my_database') or die('Could not select database'); // Performing SQL query $query = 'SELECT * FROM my_table'; $result = mysql_query($query) or die('Query failed: ' . mysql_error()); // Printing results in HTML echo "<table>\n"; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "\t<tr>\n"; foreach ($line as $col_value) { echo "\t\t<td>$col_value</td>\n"; } echo "\t</tr>\n"; } echo "</table>\n"; // Free resultset mysql_free_result($result); // Closing connection mysql_close($link); ?> PHP:
I had written LIMBO CMS long time back , Google it download it , it has a light adodb implementation.