I have a PHP project which has around 542 occurrences of the mysql_query function.
These need to be rewritten using the corresponding MySQLi methods and prepared statements.
To give an example ($dbh is a PDO object that is available to you in every file):
$sql = "SELECT * FROM users WHERE id LIKE '$id' LIMIT 1";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
$sql = "SELECT * FROM users WHERE id LIKE :id LIMIT 1";
$stmt = $dbh->prepare($sql);
$stmt->execute(array(':id' => $id));
$row = $stmt->fetch();
If you have any questions let me know.
Hello! No need for list of file/occurrencies to be hones. There's not much that need discussing either. Can work on this as soon as you move forward with the project. Regards, Dobri
66 freelancers are bidding on average €164 for this job
Hello Sir., I am ready to start it.i am highly interested in your project But i have some questions for you. So kindly leave message for me, then i'll discuss it in depth.
Hi, Let’s start. Visit my profile and see the reviews. I am highly interested to work on this project. I understand your requirements. I am 100% sure I can complete within timeline with quality Regards Jui