phphunt Posted June 2, 2013 Share Posted June 2, 2013 Hello, I try to connect Mysql via php but get this : Call to undefined function mysql_connect() May I know how to fix this ? Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/ Share on other sites More sharing options...
cpd Posted June 2, 2013 Share Posted June 2, 2013 You've likely not included the MySQL extension in your php.ini file. That said, get away from mysql and use mysqli or PDO. The mysql extension will be removed in the next PHP release. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433637 Share on other sites More sharing options...
salathe Posted June 2, 2013 Share Posted June 2, 2013 The mysql extension will be removed in the next PHP release. No, it won't. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433640 Share on other sites More sharing options...
phphunt Posted June 2, 2013 Author Share Posted June 2, 2013 you mean these : extension=php_mysqli.dll[php_MYSQLI] extension=php_pdo_mssql.dll[php_PDO_MYSQL] They are in php.ini. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433642 Share on other sites More sharing options...
DaveyK Posted June 2, 2013 Share Posted June 2, 2013 You PHP supported mysqli and PDO mysql, but not mysql() itself. That means your php is set up looking forward, rather than using old outdated mysql() stuff. mysql_* is deprecated as of 5.3.x (I think) and you shouldnt use it. Instead either use mysqli or PDO mysql, which is exactly the same query but the PHP around that query is different (they are both OOP). If you have any questions regarding mysqli() or PDO mysql, we are here to help obviously. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433659 Share on other sites More sharing options...
mac_gyver Posted June 2, 2013 Share Posted June 2, 2013 slightly off topic, but no more so than the form section it is in - what does this thread have to do with the forum section it is in - All that regex stuff you were never able to figure out. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433660 Share on other sites More sharing options...
cpd Posted June 2, 2013 Share Posted June 2, 2013 No, it won't. Care to explain? I was under the impression it was going to be removed in the next major release? Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433663 Share on other sites More sharing options...
mac_gyver Posted June 2, 2013 Share Posted June 2, 2013 the mysql_ extension must be depreciated for a time before it is actually removed and it is only officially depreciated starting in php5.5 - https://wiki.php.net/rfc/mysql_deprecation Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433667 Share on other sites More sharing options...
cpd Posted June 3, 2013 Share Posted June 3, 2013 Just goes to show how long I've not used MySQL for. I thought it was already deprecated. Link to comment https://forums.phpfreaks.com/topic/278681-call-to-undefined-function-mysql_connect/#findComment-1433779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.