RE: [PHP-WIN] PHP, MYSQL and Apache
| From: | Bill Bolte | Date: | Mon, 06 Aug 2007 21:08:42 +0000 |
| Subject: | RE: [PHP-WIN] PHP, MYSQL and Apache | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-28330@lists.php.net to get a copy of this message | ||
Looks like the mysql extension isn't enable in your php.ini. Make sure
it is enabled in the .ini and that the extension is in the appropriate
folder.
-----Original Message-----
From: KM [mailto:thalor@comcast.net]
Sent: Monday, August 06, 2007 3:59 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] PHP, MYSQL and Apache
I am attempting to use the following together....
MYSQL 5.0
Apache 2.2.4
PHP 5.2.3
PHP info I can get. I get the following statement whenever trying to
get to
mysql
Here is the PHP code for what I'm trying to do...
<?php
// Connect to the database
$dbhost = 'localhost';
$dbusername = 'root';
$dbpasswd = 'joker';
$database_name = 'simple';
$connection = mysql_connect("$dbhost","$dbusername","$dbpasswd")
or die ('Couldn\'t connect to server.');
$db = mysql_select_db("$database_name", $connection)
or die('Couldn\'t select database.');
// Generate SQL code to store data on database.
$insert_sql = 'INSERT INTO simple_table (text) VALUES (\'test text,
1,2,3\')';
// Execute SQL code.
mysql_query( $insert_sql )
or die ( 'It Didn\'t Work: ' . mysql_error() );
// Tell User we are done.
echo 'Code Inserted';
?>
Fatal error: Call to undefined function mysql_connect() in C:\Program
Files\Apache Software Foundation\Apache2.2\htdocs\test_insert_mysql.php
on
line 7
Anyone had this before and have a solution, it would be appreciated.
Keith
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.476 / Virus Database: 269.11.6/938 - Release Date: 8/5/2007
4:16 PM