Please I am getting this error

Please I just uploaded my site which was tested and running ok on my localhost to 000webhost free account I signed up for. But to my surprise, i am getting this error while running the site:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /storage/ssd3/431/6367431/public_html/db.php:2 Stack trace: #0 /storage/ssd3/431/6367431/public_html/free_tip.php(4): include() #1 /storage/ssd3/431/6367431/public_html/index.php(56): include(’/storage/ssd3/4…’) #2 {main} thrown in /storage/ssd3/431/6367431/public_html/db.php on line 2

Please anybody should assist me out pls.

Hi @dhetex!

Please go to 000webhost cPanel > Settings > General > Change PHP version > 5.6

Also, consider using mysqli_* instead of mysql_*. The one mentioned earlier is deprecated since PHP 5.* and removed since PHP 7.0

@teodor, let me do as you have advised. Thanks

@teodor, thanks a lot, the site works fine after changing the PHP version to 5.6. Thanks a mil.

Please i am having this error when i am trying to login…

Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd3/431/6367431/public_html/admin_now.php:3) in /storage/ssd3/431/6367431/public_html/admin_now.php on line 21

Pls kindly assist

i dont know why the session i used in the coding is being seen as errors.

Append

php_value output_buffering on

to /public_html/.htaccess. If file does not exist, create one.


If issue is not solved, you may need to use ob_start()/ob_end_flush()

Pls I don’t understand what you mean by append “php_value output_buffering on…”? pls kindly clarify.

Thank you :pray:

Add that string to /public_html/.htaccess file :slight_smile:

2 Likes