application/json MySQL connection and query

Completado Publicado Dec 15, 2015 Pagado a la entrega
Completado Pagado a la entrega

I need to get a script completed.

it will be used to query a mysql database.

Something like this;

script stay and work on my web server like below.

[login to view URL]<model_code>

it means;

[login to view URL]

After this request, script will answer like below :

{

"model_code": "4345edbf1e7713d8b48b14214e3248458167”,

"status": "printed”,

"num_prints": 1

}

Or

{

"model_code": "4345edbf1e7713d8b48b14214e3248458167”,

"status": "canceled”

}

Or

{

"model_code": "4345edbf1e7713d8b48b14214e3248458167”,

"status": "pending”

}

if the request hasn't been found ("Not found”) error should appear.

I made a draft writibg below, so you need to complete or write your own..

<

$servername = “mysql_ip";

$username = "username";

$password = "password";

$dbname = "myDB";

$conn = new mysql($servername, $username, $password, $dbname);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

}

$sql = "SELECT model_id, statue FROM table_name";

$result = $conn->query($statue);

if ($result = 1)

{

echo "model_code": $sql,

echo "status": "printed”,

echo "num_prints": "1"

}

else if ($statue = 2)

{

echo "model_code": $sql,

echo "status": “pending”,

}

else if ($statue = 3)

{

echo "model_code": $sql,

echo "status": “cancelled”,

}

else

{

echo “Not Found"

}

$conn->close();

?>

Java PHP Arquitectura de software

Nº del proyecto: #9124894

Sobre el proyecto

12 propuestas Proyecto remoto Activo Dec 15, 2015

Adjudicado a:

shahid864

Hi, My name is Shahid, i am working in web development from past five 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. Thank Más

$25 USD en 1 día
(661 comentarios)
7.3

12 freelancers están ofertando un promedio de $26 por este trabajo

MohanKumar28

Hi, I have good experience in working with php and mysql. We can do this. I can start now. Thanks, Mohan

$25 USD en 0 días
(135 comentarios)
6.1
SolutionToday

Hi, I am working as a web developer from the past five years. I believe in providing quality work with long term relation with clients . let discuss and start now. Please give a chance. thanks

$12 USD en 1 día
(71 comentarios)
5.5
thinkguru

transparent in my job, can complete in 0 days and in your budget. have a 5 years of experience as a lead developer.

$25 USD en 1 día
(6 comentarios)
4.6
sreekanthmk91

Hi.. I CAN DO THIS WORK IN LESS THAN 30 MINUTES I am an experienced web developer with an overall experience of 3 years in advanced technologies of web development . Kindly contact me if interested. Thanks Más

$25 USD en 0 días
(13 comentarios)
4.5
emransl

A proposal has not yet been provided

$20 USD en 1 día
(18 comentarios)
3.8
HetalVyas

Dear Employer, * Your Requirements You need to fix your REST kind of API based on model id. I am sure to provide you the solution as per your desired output. * Time I can provide you work within 5 hours

$15 USD en 1 día
(13 comentarios)
3.8
MohamedIbrahimCS

We are Egyptian team, and i am sure that you will get our work is a great as you expect, all of team have a diploma in javaSE, JavaEE, JavaFX using many technologies like Struts1, Struts2, Hibernate, JPA, Spring, Sprin Más

$55 USD en 1 día
(18 comentarios)
4.2
DennisAusOdessa

I am very thorough and ensure to complete each project with very high standards. I also speak some Spanish. I look forward to hearing back from you.

$25 USD en 3 días
(2 comentarios)
2.1
bonificial

A proposal has not yet been provided

$25 USD en 1 día
(0 comentarios)
2.0