Sign in to follow this  

php-mysql newbie problem

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all, i try to write my first php-mysql script but the php functions for mysql dont work.I wrote <?php $link = msql_connect('localhost', 'user', 'password'); ?> and the result in the browser is: Fatal error: Call to undefined function: msql_connect() in c:\phpdev\www\untitled-1.php on line. All the php functions that dont have to do with mysql work fine.Mysql from command prompt works also fine.I connected and played a little typing commands. I have the phpdev installed for apache-php-mysql.

Share this post


Link to post
Share on other sites
You have to enable the mysql extension in php.ini. Look for the section called "Windows Extensions" and remove the semicolon in front of the line reading "extension=php_mysql.dll".
That said, you would be better off using the MySQLi extension.

[edit] And by the way, msql_connect() is not a MySQL extension function, it's an mSQL extension function. Change it to mysql_connect( ... )
[edit2] Also, I think you would have gotten more answers if you had posted in the Web Development forum. I'm sure a moderator can move this thread for you.


jfl.

[Edited by - jflanglois on December 18, 2005 2:51:53 PM]

Share this post


Link to post
Share on other sites
You could shun the MySQLi functions, and go straight to either:

PDO - which is standard from PHP 5.1 onwards

Or

PEAR::DB which has been around for years.

Both will allow you to do more advanced DB stuff in a non database-specific fashion.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
You could shun the MySQLi functions, and go straight to either:

PDO - which is standard from PHP 5.1 onwards

Or

PEAR::DB which has been around for years.

Both will allow you to do more advanced DB stuff in a non database-specific fashion.

Mark


Or ADOdb. I completely agree with markr on this point. I haven't tried PDO, I'll have to give it a shot.


jfl.

Share this post


Link to post
Share on other sites

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this