Posted by Stig on Sat 22 Nov 08:50
report abuse | download | new post
- <?php
- class myClass {
- var $link, $result;
- function db_connect($server, $user, $pass, $database) { // ->db_connect("localhost", "user", "pass", "db");
- }
- }
- return true;
- }
- function error($error) {
- $file = "errors.txt";
- die("Der er opstået en uventet fejl. Hændelsen er blevet logget og Administrator vil blive informeret.");
- }
- function getRows() { // while($row = $con->getRows()) { echo $row['id']; }
- }
- function query($sql) {
- }
- }
- function getQuery($table, $what="*", $end="") { // ->getQuery("info", "*", "ORDER BY navn ASC");
- $sql = "SELECT $what FROM $table $end";
- $this->query($sql);
- }
- function cntRows() { // echo ->cntRows();
- }
- function insQuery($table, $column_data) { // ->insert("info", "navn='Navn', adresse='Adresse'");
- $sql = "INSERT INTO $table SET $column_data";
- $this->query($sql);
- }
- function delQuery($table, $where, $is) { // ->delete("info", "id", "1");
- $sql = "DELETE FROM $table WHERE $where = '$is'";
- $this->query($sql);
- }
- function updQuery($table, $what, $with, $where, $is) { // ->updQuery("info", "navn", "Navn", "id", "1");
- $sql = "UPDATE $table SET $what = '$with' WHERE $where = '$is'";
- $this->query($sql);
- }
- }
- ?>
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.