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

Finalizat Postat la acum 7 ani S-au achitat serviciile după ce au fost prestate
Finalizat S-au achitat serviciile după ce au fost prestate

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.

MySQL PHP SQL

ID Proiect: #12225759

Detalii despre proiect

59 propuneri Proiect la distanță Activ acum 7 ani

Acordat lui:

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

%selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% EUR în 1 zi
(168 Recenzii)
6.1

59 freelanceri plasează o ofertă medie de 166€ pentru proiect

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 în 3 zile
(394 recenzii)
8.0
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 Mai multe

€100 EUR în 6 zile
(405 recenzii)
8.3
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 https://www.freelancer.com/u/marchinga Mai multe

€168 EUR în 7 zile
(234 recenzii)
7.9
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 în 3 zile
(338 recenzii)
7.8
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 în 3 zile
(469 recenzii)
7.4
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 Mai multe

€100 EUR în 3 zile
(558 recenzii)
7.1
ecommercejui

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 în 3 zile
(97 recenzii)
6.9
cijagani

‌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 Mai multe

€111 EUR în 4 zile
(133 recenzii)
6.8
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 Mai multe

€99 EUR în 3 zile
(187 recenzii)
6.5
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 în 4 zile
(321 recenzii)
6.8
hasanjack

Hi sir I am Hasan Jack and I have more than 5 years of experience in PHP Development. As because of my prior experience I really feel that I can be best choice for this job. Looking forward to hear from you. Rega Mai multe

€150 EUR în 3 zile
(56 recenzii)
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 în 1 zi
(177 recenzii)
6.3
usin

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

€150 EUR în 5 zile
(85 recenzii)
6.3
prakash2813

Hi there, I have read the project details. This is an easy job for me. 2 days are more than enough for me. Message me, we can discuss over chat.

€180 EUR în 2 zile
(45 recenzii)
5.8
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. ------------------------------------------------------------------------------------- Mai multe

€170 EUR în 2 zile
(30 recenzii)
5.8
jiitendra

Hi, I have reviewed your requirement and I can do this job as per your requirement. I have a advanced skills in WORDPRESS ,PHP, API Integration, MYSQL, JavaScript, HTML, Jquery, Magento, HTML 5 ,YII frame, PSD to H Mai multe

€155 EUR în 3 zile
(39 recenzii)
6.0
SolutionToday

I am dedicated developer who believe in providing quality work within time frame. I will serve you in following PHP, Jquery, Javascript, Ajax, HTML,CSS, Joomla, Cakephp, Worpress, PSD to Responsive HTML5. I am looking Mai multe

€55 EUR în 3 zile
(71 recenzii)
5.5
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 în 5 zile
(45 recenzii)
5.6
amjadali4888

Greetings I have read your job description and I want to talk about more that regards that I can do that project within the time frame I have more than 3 years’ experience in web development skills like PHP WordPre Mai multe

€155 EUR în 3 zile
(76 recenzii)
5.2
sergioeliot3

Hi there! I'm an experienced software developer working on both .net and php technologies. And I can help you doing this conversion from the deprecated mysql_* functions to the new recommended by php standards. I Mai multe

€219 EUR în 5 zile
(49 recenzii)
5.7