Can't Get Mysql Or Mysqli To Work
Please forgive me if I provide too much information, I do not want to waste anyone's time with missing details. I recently upgraded from Linux Classic Hosting to CPanel and I am having trouble getting connected to the database. The original website is at - Removed - and works flawlessly, using PHP 5.2 (it's still up since I still have the old server up for now). I copied all the files over from the old server using FileZilla and created a new database that has the same username and password, changing the host name to localhost in Connections.php.
I have confirmed by selecting "PHP version" under the software section that I'm using PHP 5.6 and both mysql and mysqli are enabled. However I get the error: "Fatal error: Call to undefined function mysql_pconnect() in /home/someusr/public_html/Connections/terry.php on line 9" and I get an almost identical error with mysqli. I have provided a screenshot of the PHP commands from cPanel and the code below. Please help me fix this. Thanks.
I would prefer not to have to upgrade to mysqli as I am simply keeping the original site up until the new godaddy site is ready.
- Removed -
Here's the code from the original site (I've changed the names to database and password for security:
In Connections.php
And in Documents.php:
?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true" someusr
$hostname_terry = "*********.secureserver.net";
$database_terry = "database";
$username_terry = "database";
$password_terry = "password";
$terry = mysql_pconnect($hostname_terry, $username_terry, $password_terry) or trigger_error(mysql_error(),E_USER_ERROR);
?>And in Documents.php:
-
More information. I put the following code in a test file: \n"; } else { echo "mysql_connect no bueno.
\n"; } ?>
I got back "mysql_connect no bueno." I also get the same result for mysqli_connect. So obviously these functions are not loading.0 -
Godaddy fixed this! Thanks. 0 -
Hello, I'm happy to see your hosting provider was able to help address the issue. Thank you for updating us with the outcome. 0
Please sign in to leave a comment.
Comments
3 comments