bradbice Posted March 17, 2006 Share Posted March 17, 2006 I am using an example from the "PHP and MySQL Web Development" book by Welling and Thompson, and it utlizes the mysqli connection. Anyways, here's my line of code and the error it produces:[code]function db_connect(){$handle = new mysqli('localhost', 'user, 'pass', 'db'); if (!$handle) { return false; } return $handle;}[/code]and the error:Fatal error: Cannot instantiate non-existent class: mysqli in d:\inetpub\technitrolinc\cms\db_fns.php on line 11I am using php 4.4.1 on a shared host.Is there any way, if the above can't work with that version, that I can get this to work without using mysqli? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 17, 2006 Share Posted March 17, 2006 mysqli support is for PHP5 and upwards. It is not available to PHP4.x versions.If you wish to use the mysqli functions see if your host will upgrade the current php version to php5 and see if they can compile php with mysqli support. Or just install a local server on your computer easy to do and allows you to learn php offline! saves you time but not uploading files to your host all the time instead you run them from the comfort of your own computer.Look into pakages like wamp5 or XAMPP, or install Apache, PHP5 and MySQL on your computer manually - your book may show you haw to install these on your computer. All the packages mentioned above are free download and use, not costs involved Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.