Rewrite all occurances of mysql_query() to MySQLi/Prepared Statements


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):

Rewrite this:

$sql = "SELECT * FROM users WHERE id LIKE '$id' LIMIT 1";

$result = mysql_query($sql) or die(mysql_error());

$row = mysql_fetch_array($result);

To this:

$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.

Skills: MySQL, PHP, SQL

See more: insert check query table mysql, software write mq4, load query database mysql, query update mysql, software write chip epson, useful software write book, cron query update mysql linux, query script mysql, software write web specs, query status mysql bash, create query java mysql, hired specific date query result mysql, simple search query result mysql, free software write user guide, sugarcrm query failed mysql error 1065 query empty, software write edid, free software write company profile, query failed mysql error 1065 query empty, software write websites idea, software write book images, software write books, software write protection, mysql query remote mysql database, free software write book, software write book

Project ID: #12225759

Awarded to:


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

€45 EUR in 1 day
(130 Reviews)

66 freelancers are bidding on average €164 for this job


Hi there, I am interested in more details that you can provide for the project. Message me to discuss in details. Please take a look at our client's experience with us here More

€168 EUR in 7 days
(188 Reviews)

Greetings, We would like to avail required solution. And can start immediately. To start provide, code and db with sample data. Best Regards.

€177 EUR in 3 days
(337 Reviews)

i have 8+ years of experience. Can we discuss the project. Please initiate a chat with me so that we can discuss the project at a broader level. Why you should hire me- 1. I have a very good communication skills More

€263 EUR in 3 days
(55 Reviews)

Hello We will rewrite all 542 occurrences or more of of the mysql_query function to mysqli Rest be assured we have done this for lot of clients after webhosts have upgraded MySQL version 4.1.13 which uses MySQLi ex More

€100 EUR in 6 days
(203 Reviews)

I am a skilled developer, I can update your site to use mysqli rather than mysql. let discuss more via private message, thanks.

€111 EUR in 3 days
(310 Reviews)
€250 EUR in 3 days
(445 Reviews)

Hi I have understand what you need. Please accept the bid and send me the files. I am ready to start it. Thanks Shihan

€100 EUR in 4 days
(297 Reviews)

Hello , I have reviewed the following requirements. I would like to discuss the features in detail. We have expertise in Responsive Web Design, PHP, MySql, CodeIgniter,Wordpress, Angular JS, Web application Deve More

€750 EUR in 10 days
(64 Reviews)

Hi, My name is Imran and I have been working as a HTML/CSS/PHP/Wordpress Developer, Designer and Coder for the last 8 years. About Your Project: -------------------------- I have read your project details and More

€99 EUR in 3 days
(127 Reviews)

HI My Notion : "No Satisfaction, No Payment" We have expertise in Web Design & Development. Please check our client reviews on Elance to determine the quality of our work.: Lets discuss in detail and start now? More

€155 EUR in 3 days
(62 Reviews)

Hi, i'm interested, could you give me more details please? could you send the php file with more occurrences? regards

€80 EUR in 1 day
(41 Reviews)

PHP Program Developer 100% Satisfaction Guaranteed 7 Years Experienced Invite To Chat Discuss Further Details!

€150 EUR in 5 days
(78 Reviews)

Warm Greetings !! You can view our full portfolio at: We would be glad to work with you on this requirement. We are a website designing and application development More

€244 EUR in 3 days
(108 Reviews)

Hi, My name is Shahid, i am working in web development from past four years. Will provide you quality work and hopefully we will have long term relationship in web development. Let me know if i can help you. let's More

€100 EUR in 3 days
(210 Reviews)
€222 EUR in 3 days
(190 Reviews)

I am Yogesh sanwal, 5+ years experienced inwebsite and e-commerce development using PHP/MySQL. Take a look to my last work: http://ww More

€150 EUR in 5 days
(99 Reviews)

I have done mysql to mysqli upgrade to many sites and php version updates to php scripts. I have good experience. Thanks, Suraj

€150 EUR in 5 days
(42 Reviews)

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.

€555 EUR in 3 days
(81 Reviews)

‌I have a lots of experience in PHP MVC,MySQL, Wordpress, Codeigniter, laravel and Web Designing. my aim to deliver quality products to our customers within specified deadline. If hired by you I will put in my best w More

€111 EUR in 4 days
(84 Reviews)

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

€250 EUR in 3 days
(28 Reviews)