Echo89

My Framework Usage.

Sep 30th, 2013
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. define("FW_INC", TRUE);
  4. require_once("./system/framewerk.php");
  5. $framewerk = new framewerk();
  6.  
  7. $db = $framewerk->database->connect("mysqli", "localhost", "root", "", "framewerk", 3306);
  8. $db->query("CREATE TABLE IF NOT EXISTS `users`(
  9.     `id` INT NOT NULL AUTO_INCREMENT,
  10.     `name` VARCHAR(50) DEFAULT '',
  11.     PRIMARY KEY(`id`)
  12. ) Engine=InnoDB;");
  13. $name = $db->escape("Caelan Stewart");
  14. for($i = 0; $i < 4; $i++)
  15. {
  16.     $db->query("INSERT INTO `users`(
  17.         `name`
  18.     ) VALUES (
  19.         '$name'
  20.     )");
  21. }
  22. $result = $db->query("SELECT * FROM `users` WHERE `name` = '$name' AND `id` < 100 ORDER BY `id`");
  23. while($array = $db->fetch_array($result))
  24. {
  25.     print_r($array);
  26.     print "<br />";
  27. }
  28. $db->close();
  29.  
  30. ?>
RAW Paste Data