Reply to Re: not able to find the mysqli.dll

Your name:

Reply:


Posted by Sy on 10/23/06 18:29

$mysqli is a function not a class.
If you want to reuse this function then you need to change the code.

class Mysqli

On Oct 23, 4:18 am, david...@gmail.com wrote:
> trying to figure out how to use a mysql database with PHP. I ran the
> following code:
> <?php
> // defines database connection data
> define('DB_HOST', 'localhost');
> define('DB_USER', 'ajaxuser');
> define('DB_PASSWORD', 'practical');
> define('DB_DATABASE', 'ajax');
> // connect to the database
> $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_DATABASE);
> // the SQL query to execute
> $query = 'SELECT user_id, user_name FROM users';
> //execute the query
> $result = $mysqli->query($query);
> // loop through the results
> while ($row = $result->fetch_array(MYSQLI_ASSOC))
> {
> // extract user id and name
> $user_id = $row['user_id'];
> $user_name = $row['user_name'];
> // do somthing with the data (here we output it)
> echo 'Name of user #' . $user_id . ' is ' . $user_name . '<br/>';
> }
> // close the input stream
> $result->close();
> // close the database connection
> $mysqli->close();
> ?>
>
> I get the following message suggesting that it can't find the
> mysqli.dll file:
> "Fatal error: Class 'mysqli' not found in
> C:\Apache\htdocs\ajax\foundations\mysql\index.php on line 13"
>
> I have the following in php.ini:
> extension=php_mysqli.dll
>
> I have php_mysqli.dll in php\ext\. I assume that this is where the
> class would be implemented. Is that correct?
>
> Any thoughts what the issue might be?
>
> TIA,
> David

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация