Convert MySQL PHP Code to include MySQLi Prepared Statements

En curso Publicado Oct 19, 2015 Pagado a la entrega
En curso Pagado a la entrega

ONLY BID IF YOU CAN START AND COMPLETE IMMEDIATELY!

Simple Task - Convert this short piece of code to include prepared statements for efficiency and security. I'm aware it's poorly designed thats what I need you to fix. Plenty more work for best cost and quality work,

$mysqli = new mysqli($servername, $username, $password, $dbname);

/* check connection */

if ($mysqli->connect_errno) {

printf("Connect failed: %s\n", $mysqli->connect_error);

exit();

}

if ($_GET['sort'] == 'date') { $sort_query = 'outbounddeparture ASC';}

else {$sort_query = 'priceperadult ASC';}

$form_airport = $_GET['form_airport'];

$form_lessthan = $_GET['less-than'];

$from_month = $_GET['month'];

$date = $from_month;

$startdate = date("m", strtotime ( $date ) );

$enddate = date("m", strtotime ( '+1 month' , strtotime ( $date ) ));

$destination = $_GET['form_destination'];

if ($from_airport == 'LON') {$airport_query = " AND outbounddepartureairport IN ('LHR','LGW','STN','LTN','SEN')";}

else{$airport_query = "AND outbounddepartureairport = '{$form_airport}'";}

$query = "SELECT MIN(priceperadult), hotelname, priceperadult, duration, outbounddepartureairport, deeplinkurl, hotelidentifiercode, outbounddeparture

FROM search_results

WHERE priceperadult < '{$form_lessthan}'

".$airport_query."

AND outbounddeparture >= '2016-{$startdate}-01'

AND outbounddeparture < '2016-{$enddate}-01'

AND outbounddeparture < '2016-{$enddate}-01'

AND holidayresort = '{$destination}'

GROUP BY hotelname

ORDER BY {$sort_query}

";

$result = $mysqli->query($query);

while ($row = $result->fetch_assoc()) :?>

...........

MySQL PHP

Nº del proyecto: #8716830

Sobre el proyecto

15 propuestas Proyecto remoto Activo Oct 19, 2015

15 freelancers están ofertando un promedio de £16 por este trabajo

rajeshsonisl

Hello! With 98% to 99% completion rate, 850+ successfully completed projects, and a 5.00 reputation (maximum possible, 5.0) (Yes, not even 4.99 average rating, can be verified on my profile page [login to view URL] Más

£27 GBP en 1 día
(672 comentarios)
7.8
techvolcano

Hi, We can convert it into mysqli or pdo with proper placeholder in sql Ready to start now. Regards

£20 GBP en 1 día
(224 comentarios)
6.6
rockeinstone

A proposal has not yet been provided

£18 GBP en 1 día
(115 comentarios)
6.2
bestphpjobs

I read your project description and that make sense , at there you described issue very well. I know all stuff good that you want for this job, PHP, javascript, mysql, html, etc very well. I can manage this job very we Más

£13 GBP en 1 día
(149 comentarios)
6.2
kotharigaurav90

Hello, i have checked your project and would like to have your project. I am confident to fulfill your requirements in timely manner, along with quality work. Please check your pmb.

£18 GBP en 1 día
(42 comentarios)
5.7
avenaz

A proposal has not yet been provided

£20 GBP en 1 día
(15 comentarios)
4.6
mrRawal

A proposal has not yet been provided

£13 GBP en 0 días
(16 comentarios)
3.8
clagtech

Dear Sir I am ready to convert this short piece of code to include prepared statements for efficiency and security right away. Please discuss details in chat. Waiting for your early reply. Thanks

£13 GBP en 0 días
(5 comentarios)
2.8
williamyose

Hi Sir, I already worked with PHP and MySQL for various projects. I can do it today. I will use PDO PHP tutorial to create prepared statement to make neater query. Once approved I will start. Thanks

£13 GBP en 1 día
(8 comentarios)
2.8
mikeorozco94

As requested, I can start on this immediately and have it delivered as soon as it is completed. Conversion of this to prepared statements would require testing, so if possible, can you send me the schema of your dat Más

£13 GBP en 1 día
(7 comentarios)
2.1
NavnitK

A proposal has not yet been provided

£13 GBP en 1 día
(2 comentarios)
1.3
rakeshsiva91

Hi, This task is perfect for me. i can finish it in few minutes. please send me a message if you are interested.

£12 GBP en 1 día
(1 comentario)
0.3