application/json MySQL connection and query
$10-30 USD
Paid on delivery
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();
?>
Project ID: #9124894
About the project
12 freelancers are bidding on average $26 for this job
Hi, I have good experience in working with php and mysql. We can do this. I can start now. Thanks, Mohan
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
transparent in my job, can complete in 0 days and in your budget. have a 5 years of experience as a lead developer.
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 More
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
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 More
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.