mysql()
- The old mysql_* functions deprecated in PHP 5.5. In this short tutorial you will get a instruction how to solve this error message.
Why was mysql deprecated in PHP 5.5?
Because the below listed are missing points in PHP 5.5
- Stored Procedures
- Prepared Statements
- (SSL-)Encryption
- Compression
- Full charset support
How to solve the warnings?
Currently mostly many MySQL connections in PHP use this construct:
Replace:
<?php
$link = mysql_connect('localhost', 'user', 'password');
mysql_select_db('dbname', $link);
?>
With
The way with MySQLi would be like this:
<?php
$link = mysqli_connect('localhost', 'user', 'password', 'dbname');
Filthy and fastest solution:
Suppress all deprecated warnings including them from mysql_*:
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
Solution for your problem
Deprecated features in PHP 5.5.x
The original MySQL extension is now deprecated, and will generate E_DEPRECATED errors when connecting to a database. Instead, use the MYSQLi or PDO_MySQL extensions.
replace all mysql_
functions into mysqli_*
functions
You have to make concatenation of the PHP variables in order to print it. Since then alone it will display the data.
Replace:
print '<a href="systemlogin2.php">$row['company_name']</h2>';
print '<p><img border="0" src="$row['company_logo']" width="230" height="198"></p>';
With:
print '<a href="systemlogin2.php">'.$row['company_name'].'</h2>';
print '<p><img border="0" src="'.$row['company_logo'].'" width="230" height="198"></p>';