|
Posted by mich dobelman on 08/22/06 04:03
I cannot reference the values in side of config.php
$dbhost,$dbuser ,$dbpasswd ,$dbname why?
<?php
require_once('includes/db.php'); //db connection functions
require_once('config.php'); //db connection parameters
class DBRegion{
var $db;
function DBRegion(){
}
function open(){
$this -> db = new sql_db($dbhost , $dbuser , $dbpasswd , $dbname ,
false);
if( !$this -> db -> db_connect_id )
{
die( "Could not connect to the database" );
}
}
function close(){
$this -> db -> sql_close();
}
function updateName( $id, $name ){
$sql = "update web_coupon_region set name = '$name' where id = $id ";
$result = $this -> db -> sql_query( $sql ) or die( "Coun't proceed with
the following sql: ".$sql );
}
//UPDATE `web_coupon_region` SET `mdate` = '2006-08-16 05:05:55' WHERE
`id` = '1' LIMIT 1 ;
function updateModDate( $id, $date )
{
//$this -> db = new sql_db($dbhost , $dbuser , $dbpasswd , $dbname ,
false);
$sql = "update web_coupon_region set mdate = '$date' where id = '$id'";
$result = $this -> db -> sql_query( $sql ) ;
if(!$result ){
$error = $this -> db -> sql_error();
die( "Coun't proceed with the following sql: ".$error['message'] );
}
}
}
?>
[Back to original message]
|