PHP error

My php files doesn't seem to work when I upload it to an online web hosting it a search and register web but it doesn't produce any error and it doesn't do anything related to php but if I put incorrect credentials it does indicate that Access is denied.

Anyone know what the course of this, but if I upload the same website to my other free webhosting it does search.
Mlungisi NdlelaFounder of MCSIDevelopers also a software developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Olaf DoschkeSoftware DeveloperCommented:
Probably not at all PHP related but a password protected (basic auth) folder?
Apache hosting is there some .htaccess in the folder of the PHP script?
Or is it even just file permissions?
Check with the hoster FAQ.

Bye, Olaf.
Chris StanyonWebDevCommented:
You might want to post a link to the page or a copy of your code. Could be a number of reasons why it's not working
Julian HansenCommented:
Does the PHP script work on your local server?
Have you checked the error logs on the server. Usually with hosting packages they turn errors off and redirect PHP errors to a file in the web_root (look for a file error.log or similar)

You say the script does not do anything but then mention that you get an access denied when entering credentials - that means it is doing something.

Can you describe what your script is supposed to do.

Can we see some code or a link

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Mlungisi NdlelaFounder of MCSIDevelopers also a software developerAuthor Commented:
Thanks guys. the page is at that doesn't work but the one that is working is at

I've just checked the server log an I noticed that it has this error
PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /home/findmesa/public_html/cnn.php:2

Open in new window

but on I don't have this issue but I use the same script. About entering the credentials, I meant with the correct credentials it seems as if it doesn't even do anything but when I enter wrong it does produce that error of access denied.
Mlungisi NdlelaFounder of MCSIDevelopers also a software developerAuthor Commented:
Here is the code I'm using
mysql_connect("localhost","myusername","xxxxxxxxxxx") or die("Could not connect");
//mysql_connect("localhost","myusername","xxxxxxxxxxx") or die("Could not connect");
mysql_select_db("findmesa_sfind") or die("Could not find database!");
$output = '';
// Collect data
$searchq = $_POST['searchVal'];
$querrry = mysql_query("SELECT * FROM `findmesa_sfind`.`dta` WHERE tags LIKE '%$searchq%' OR name LIKE '%$searchq%' OR category LIKE '%$searchq%' OR username LIKE '%$searchq%' OR addr2 LIKE '%$searchq%' OR city LIKE '%$searchq%' OR province LIKE '%$searchq' OR country LIKE '%$searchq%' OR company LIKE '%$searchq%' LIMIT 0,10 ") or die(mysql_error());//LIMIT 0,10 order by lp
$count = mysql_num_rows($querrry);

$output = '<div style="color:#000000"><center><h1 class="mbr-section-title display-1"><SMALL>SEARCH RESULT OF <I>' .$searchq. '</I></SMALL></h1></center></div>';
$qaw = 0;
$csx = 0;
if($count == 0){
$output .= '<div><div style="color:#000000">There was no search results!</div></div>';

while($row = mysql_fetch_array($querrry))  {
	$csx += 1;
$id = $row['id'];
$company = $row['company'];
$desc = $row['desc'];
$tel = $row['tel'];
$cell = $row['cell'];
$email = $row['email'];
$website = $row['url'];
$city = $row['city'];
$country = $row['country'];
$listingpos = $row['lp'];
$status = $row['status'];
$imgData = $row['image'];

if($csx == 1){
	$qaw = $listingpos +1;
	$querrrya = mysql_query("UPDATE `findmesa_sfind`.`dta` SET `lp`='".$qaw."' WHERE `id`='".$id."'") or die("Could not update database");


	$output .= '<div style="color:#000000"><hr /><h1><a href="http://' .$website. '">' .$company. ' ' .$csx.'</a></h1><a href="http://'.$website.'"><img class="imgl borderedbox inspace-5" src="data:image/png;base64,'.base64_encode($imgData).'" alt=""></a><p><div style="color:#000000">' .$desc. '</p> Cell No: ' .$cell. '<br /><a href="mailto:' .$email. '">' .$email. '</a> <br />' .$city.','.$country. '</div></div><p></p>';//<hr />



Open in new window

Julian HansenCommented:
The mysql library has been deprecated and removed in later versions of PHP.

What has happened is your host is using a version of PHP that no longer supports the old MySQL

You will need to either change your code to use MySQLi (or PDO)

You could also try ask your host if it is possible to use an earlier version of PHP

Refer to this link for more details
David FavorLinux/LXD/WordPress/Hosting SavantCommented:
As Julian said, the message...

PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /home/findmesa/public_html/cnn.php:2

Open in new window

Means you're using pre-PHP-7.0 mysql_*() API calls + your runtime environment is running PHP-7.0 or above (as it should).

Just change all your mysql_*() calls to mysqli_*() calls + all should be well.

In most cases mysql_*() calls are directly replaced by mysqli_*() calls. In some rare cases, some mysql_*() code has been completely dropped, so you may have to do a bit of extra coding to get around these few dropped routines.

If you have 100s or 1000s of files to convert from PHP-5.X to PHP-7.x the project... provides a tool to find all incompatibilities + another tool to mass edit PHP files + auto-magically fix many of these problems.

I've been using these tools with clients for a year now. A massive time saver. Even with a few files, these tools may catch slight problems you miss by eyeballing your code.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.