Completed

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.

To answer a common question:

The mysql_query function is used in 140 of the 288 PHP files.

I can provide a list with all occurrences (file name + line number).

I did a recount and it is actually 662 occurrences of the mysql_query function.

I used "grep -or 'mysql_query' . | wc -l" for the counting.

Sorry for the inconvenience.

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

About the Employer:
( 1 review ) Duisburg, Germany

Project ID: #12225759

Awarded to:

justTry

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
(143 Reviews)
5.8

63 freelancers are bidding on average €163 for this job

fattahaabdul

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
(73 Reviews)
7.7
softservicesvw

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
(338 Reviews)
7.7
OutsourceMan

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
(226 Reviews)
7.7
marchingantssl

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 [url removed, login to view] More

€168 EUR in 7 days
(210 Reviews)
7.7
€250 EUR in 3 days
(536 Reviews)
7.2
tlchung

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
(374 Reviews)
7.3
JunaidAhmed07

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
(210 Reviews)
7.0
usatechsoft

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
(102 Reviews)
7.1
AxonTech

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
(97 Reviews)
7.1
yogeshssanwal

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

€150 EUR in 5 days
(159 Reviews)
6.6
shihan033010

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
(305 Reviews)
6.8
shahid864

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
(263 Reviews)
6.3
imranphp

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
(136 Reviews)
6.3
elbruninh

Hi, i'm interested, could you give me more details please? could you send the php file with more occurrences? regards [url removed, login to view]

€80 EUR in 1 day
(65 Reviews)
6.2
€222 EUR in 3 days
(210 Reviews)
6.3
momentumsoftware

Warm Greetings !! You can view our full portfolio at: [url removed, login to view] 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
(117 Reviews)
6.0
usin

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

€150 EUR in 5 days
(84 Reviews)
6.3
glennwilkins

sir pm me i can do this .. sir pm me i can do this .. sir pm me i can do this .. sir pm me i can do this ..

€50 EUR in 1 day
(109 Reviews)
6.0
suraj2

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
(45 Reviews)
5.6
romanapanovich

Updated php?)) I was in the same situation ok. I can do it. I will copy code into my server, work with it and then give it to You. ------------------------------------------------------------------------------------- More

€170 EUR in 2 days
(27 Reviews)
5.6