[ VERSION 1 ]
<?php
class Sql {
// Set properties
//DB info
var $hostname_local = "localhost";
var $database_local = "mydb";
var $username_local = "root";
var $password_local = "password";
var $local;
var $query_rs_biz;
var $rs_biz; function Sql() {
$this->methodTable = array(
"getRecords" => array(
"description" => "return a SQL record",
"access" => "remote",
"arguments" => array("")
)
);
}//SQL
//Create method to retreive records
function getRecords() {$this->local = mysql_pconnect($this->hostname_local, $this->username_local, $this->password_local) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($this->database_local, $this->local);
$this->query_rs_biz = "SELECT * FROM directory ORDER BY Business ASC";
$this->rs_biz = mysql_query($this->query_rs_biz, $this->local) or die(mysql_error());
//return $this->row_rs_biz; return $this->rs_biz; } } ?>
[ VERSION 2 ]
<?php
class Sql2 {
// Set properties
//DB info
var $hostname_local = "localhost";
var $database_local = "Blisting";
var $username_local = "root";
var $password_local = "URAredneck"; function Sql2() {
$this->methodTable = array(
"getRecords" => array(
"description" => "return a SQL record",
"access" => "remote",
"arguments" => array(),
"returns" => "sql records"
),
"getRecCount" => array(
"description" => "return the row count from the
getRecords method",
"access" => "remote",
"arguments" => array(),
"returns" => "sql row count"
)
);
}//SQL
//Create method to retreive records
function getRecords() {$local = mysql_pconnect($this->hostname_local, $this->username_local, $this->password_local) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($this->database_local, $local);
$query_rs_biz = "SELECT * FROM directory ORDER BY pID ASC";
$rs_biz = mysql_query($query_rs_biz, $local) or die(mysql_error());
//return results; return $rs_biz; } } ?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

