Hi to all,
I am new to this form and ofcource for PHP as well.
My programmer developed Bookstore system which workes fine on HP4, Apache 1.3 and MySQL 4.12.
I brought a new notebook OS vista. I am downloaded WAMPS5 and installed but some pages code is not working. When I click the page following codes appears. Please suggest how to over come this problem.
USER; $pass = $this->PASS; $server = $this->SERVER; $dbase = $this->DBASE; $conn = mysql_connect($server,$user,$pass); if(!$conn) { $this->error("Connection attempt failed"
; } if(!mysql_select_db($dbase,$conn)) { $this->error("Dbase Select failed"
; } $this->CONN = $conn; return true; } function select ($sql="", $column=""
{ if(empty($sql)) { return false; } if(!eregi("^select",$sql)) { //echo "
Wrong function silly!
\n"; return false; } if(empty($this->CONN)) { return false; } $conn = $this->CONN; $results = mysql_query($sql,$conn); if( (!$results) or (empty($results)) ) { mysql_free_result($results); return false; } $count = 0; $data = array(); while ( $row = mysql_fetch_array($results)) { $data[$count] = $row; $count++; } mysql_free_result($results); return $data; } function get_Cats ($CatParent= ""
{ if(empty($CatParent)) { $CatParent = "IS NULL"; } else { $CatParent = "= $CatParent"; } $sql = "SELECT CatID,CatName FROM Categories WHERE CatParent $CatParent "; $results = $this->select($sql); return $results; } // The primer for a recursive query function get_ParentsInt($CatID=""
{ if(empty($CatID)) { return false; } unset($this->TRAIL); $this->TRAIL = array(); $this->get_Parents($CatID); } function get_Parents ($CatID=""
{ if( (empty($CatID)) or ("$CatID" == "NULL"
) { return false; } $sql = "SELECT CatID,CatParent,CatName from Categories where CatID = $CatID order by CatName"; $conn = $this->CONN; $results = mysql_query($sql,$conn); if( (!$results) or (empty($results)) ) { mysql_free_result($results); return false; } while ( $row = mysql_fetch_array($results)) { $trail = $this->TRAIL; $count = count($trail); $trail[$count] = $row; $this->TRAIL = $trail; $id = $row["CatParent"]; $this->get_Parents($id); } return true; } function get_CatIDFromName($CatName=""
{ if(empty($CatName)) { return false; } $sql = "SELECT CatID from Categories where CatName = '$CatName' "; $results = $this->select($sql); if(!empty($results)) { $results = $results[0]["CatID"]; } return $results; } function get_CatNames( $CatID=""
{ if($CatID == 0) { return "Top"; } $single = false; if(!empty($CatID)) { $single = true; $CatID = "WHERE CatID = $CatID"; } $sql = "SELECT CatName from Categories $CatID order by CatName"; $results = $this->select($sql); if($single) { if(!empty($results)) { $results = $results[0]["CatName"]; } } return $results; } } // End Class ?>
Fatal error: Class 'MySQL' not found in D:\wamp\www\kbc\books\add_books.php on line 158