RE: PHP, MYSQL and Apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx] 
Sent: Monday, August 06, 2007 3:59 PM
To: php-windows@xxxxxxxxxxxxx
Subject:  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
 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux