My code is working on PHP4, Apache 1.3 and MySQL 4.12 but on WAMPS5 some codes
Posted by: naguri (---.singnet.com.sg)
Date: August 27, 2007 06:47AM

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"winking smiley; } if(!mysql_select_db($dbase,$conn)) { $this->error("Dbase Select failed"winking smiley; } $this->CONN = $conn; return true; } function select ($sql="", $column=""winking smiley { 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= ""winking smiley { 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=""winking smiley { if(empty($CatID)) { return false; } unset($this->TRAIL); $this->TRAIL = array(); $this->get_Parents($CatID); } function get_Parents ($CatID=""winking smiley { if( (empty($CatID)) or ("$CatID" == "NULL"winking smiley) { 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=""winking smiley { 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=""winking smiley { 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


Options: ReplyQuote
Re: My code is working on PHP4, Apache 1.3 and MySQL 4.12 but on WAMPS5 some cod
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: August 27, 2007 04:07PM

use full php tags

ie: <?php

not:
<?

make sure the file has a .php extension and save it in c:\wamp\www folder.



CyberSpatium
----------------------
WAMP English Forum Admin

I have WAMP5 working with (for development use only):
Windows Vista Ultimate x64 (64 bit)
Kaspersky Internet Security Suite 7.0.x
Spyware Terminater 2.x
CounterSpy 2.5.x


Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.


Clarify Loans
Mortgage and Home Loan Advice


LaxGo Web Directory
Powerful human edited web directory of quality, spam-free sites organized via a comprehensive category structure.

Options: ReplyQuote


Sorry, only registered users may post in this forum.