echo "<br>Adding data to the table from an array...<br>"; $data = array('user_name' => 'Micah Carrick', 'email' => '*****@*****.**', 'date_added' => '04/13/2003 4:12 PM', 'age' => 24, 'random_text' => "This ain't no regular text. It's got some \"quotes\" and what not!"); $user_id = $db->insert_array('users', $data); if (!$user_id) { $db->print_last_error(false); } $db->print_last_query(); $db->dump_query("SELECT * FROM users WHERE user_id={$user_id}"); // This is similar to the above, only it updates the data rather than insert. Also // you'll notice that in the first one we used a string to represent the date // and this time we're using the time function to generate a timestamp. This is // done to illustrate the class' ability to convert the date and time formats // to a MySQL compatible format. I like that alot :) echo "<br>Updating the data in the table by changing the date_added... "; $data = array('date_added' => time()); $rows = $db->update_array('users', $data, "user_id={$user_id}"); if (!$rows) { $db->print_last_error(false); } if ($rows > 0) { echo "{$rows} rows updated."; } $db->print_last_query(); $db->dump_query("SELECT * FROM users WHERE user_id={$user_id}"); // And now I'll just show you really quickly how to use this class to itereate // a results set. It's not much differnt that without using the class. In fact, // if you don't need to use the stripslashes and addslashes, that is, if // $db->auto_slahses=false then using the get_row() function is totally pointless // and can be replaced with mysql_fetch_array($r); echo "<br>Example of how to iterate through a result set...<br> "; $r = $db->select("SELECT user_name, email FROM users");