background preloader


Facebook Twitter

Welcome to the PHP Classes Repository. Easy PHP MySQL DB. PHP MySQL wrapper v3 - PHP5 Singleton Class to easily call mysql functions. // insert a new record using insert() $data['news_id'] = 47;$data['title'] = "You're Top"; // insert() will auto escape it for us$data['created'] = "NOW()";// it knows to convert NULL and NOW() from a string // insert() parameters// table name (ideally defined as a constant, but did not for this example)// assoc array with data (does not need escaped)// insert() returns// primary id of the inserted record. you can collect or ignore$primary_id = $db->insert("news", $data); // then use the returned ID if you wantecho "New record inserted: $primary_id"; // would create the INSERT INTO `news` (`news_id`,`title`,`created`) // VALUES ('47', 'Your\'re Top', NOW())