简体   繁体   中英

Fatal error: Call to undefined function mysql_connect()

i changed my hosting from bigrock to google cloud. previously my code was working good without any single error when it is in bigrock php version 5.4.45, but now when i shifted to google cloud the version is about 5.6 and my code used to show many errors later i changed the php version of my google cloud server to 5.4.45 same as bigrock, even now i am getting this

Fatal error: Call to undefined function mysql_connect().

i don't understand why this code shows errors in google cloud with same php version when it is working good at bigrock hosting.

The mysql_* based functions were deprecated with PHP 5.5.x .

Even though you may have "rolled back" the version, it is likely that the old mysql libraries are not available/present on the cloud. Consider updating to the mysqli -based functions (which is not too difficult a transition, but there are differences) or use PDO.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM