UpdateRow ($params=array(), &$debug=false) DeleteRow ($params=array(), &$debug=false) JoinFetchRow ($params=array(), &$debug=false) InsertOrUpdateRow ($params=array(), $UniqueField=null, &$debug=false) InsertUpdateOrDeleteRow ($params=array(), $UniqueField=null, &$debug=false) ---------------------------------------------------------------------------- SERVER::dump($var); will display the contents of the variable: array/object or otherwise */ require_once 'lib/db1.class.php'; $DB = new DB1($DBc); $DB->OpenConnection(); //accociative select all ------------------------------------------------ $fetchParams = array('table' => 'users2', 'select_items' => '*', 'row_key' => 'id'); SERVER::dump($fetchParams); //display params $result = $DB->FetchRow($fetchParams); $result = json_encode($result, JSON_PRETTY_PRINT); SERVER::dump($result); //display results SERVER::dump($result); //display results //============================================================== //example fo some capabilities $fetchParams = array('table' => 'users2', 'select_items' => array('username', 'id'), 'order' => 'desc', 'by' => 'id', 'row_key' => 'id', 'limit' => 5, 'where_items' => array('deleted' => 0, 'blocked' => 1)); $result = $DB->FetchRow($fetchParams); //SERVER::dump($result); //============================================================== // experiment using "magic methods" //users2 is the table name... you can see where this can go... $result = $DB->users2->FetchAll(); //SERVER::dump($result);
$get = $_GET['by']; continue; case 'emission': $question = 'Least CO2 Emissions'; $get = $_GET['by']; continue; default: header('Location: ' . WEB_JACPHP . 'index.php'); exit; } $DB = new DB1($DBc); $DB->OpenConnection(); //================================================================== //Fetch car dara ---------------------------- $fetchParams = array('table' => 'records', 'select_items' => array($get, 'year', 'maker', 'model', 'cartype', 'img'), 'order_by' => $get . ' ASC', 'limit' => '0,10'); $fetch = $DB->FetchRow($fetchParams); //Build array of Cars -------------------------- $A = array(); foreach ($fetch as $row) { $choice = $row[$get]; $year = $row['year']; $model = $row['model']; $maker = $row['maker']; $cartype = $row['cartype']; if (empty($row['img'])) { $img = WEB_CONTENT . 'images/missing_car.png'; } else { $img = $row['img']; } $A[$choice . $cartype . $make . $model . $year] = [$get => $choice, 'year' => $year, 'model' => $model, 'maker' => $maker, 'cartype' => $cartype, 'img' => $img]; }
error_reporting(E_ERROR | E_PARSE); //Easy Code No warings/notices errors require_once 'lib/server.class.php'; //Paste to unlock require_once 'lib/db1.class.php'; $DBc = array('host' => 'localhost', 'username' => 'root', 'password' => 'root', 'database' => 'jacphp'); $DB = new DB1($DBc); $DB->OpenConnection(); //============================================================== //======================================================================= $limit = 1000; $page = isset($_GET['p']) ? $_GET['p'] : 1; // default page 1 $offset = $limit * ($page - 1); $fetchParams = array('table' => 'records', 'select_items' => '*', 'limit' => $limit, 'offset' => $offset); $man = $DB->FetchRow($fetchParams); //$result = $DB->CountRow($fetchParams); //SERVER::dump($man); $arr = array(); print '<script> var filepath = "Wrong.txt"; // Use this instead var fileObject = fso.OpenTextFile(filepath, 8, true); function append(var) { fso.WriteLine(var); fso.WriteLine("\\n"); } </script>'; print '<iframe name="myFrame"></iframe>'; $count = 0; foreach ($man as $row) {
</script> <?php error_reporting(E_ERROR | E_PARSE); //Easy Code No warings/notices errors require_once 'lib/server.class.php'; //Paste to unlock require_once 'lib/db1.class.php'; $DBc = array('host' => 'localhost', 'username' => 'root', 'password' => 'root', 'database' => 'jacphp'); $DB = new DB1($DBc); $DB->OpenConnection(); //============================================================== //example fo some capabilities $fetchParams = array('table' => 'records', 'select_items' => 'maker', 'row_key' => 'maker', 'flat_result' => true); $man = $DB->FetchRow($fetchParams); //$result = $DB->CountRow($fetchParams); //SERVER::dump($result); $i = 1; $fetchThis = array('table' => 'records', 'select_items' => array('year', 'maker', 'model', 'cartype'), 'limit' => 100); $all = $DB->FetchRow($fetchThis); $working = array(); $url = array(); $num = 0; foreach ($all as $i) { $theMaker = trim($all[$num][maker]); $theYear = trim($all[$num][year]); $theType = trim($all[$num][cartype]); $theModel = trim($all[$num][model]); $URL = 'http://www.edmunds.com/' . $theMaker . '/' . $theModel . '/' . $theYear; $URL = str_replace(' ', '-', $URL);