Completed

PHP Script To Insert Data Into MYSQL Database

I want a php script that automatically adds data to my database from an api response (I already set the api response up)

here is what I currently have...

I basically just need it to automatically add data to database.

<?php

//connect to mysql db

$con = mysql_connect("myip","user","pw") or die('Could not connect: ' . mysql_error());

//connect to the employee database

mysql_select_db("dbname", $con);

//read the json file contents

$data = file_get_contents('http://urloffileconents/');

//convert json object to php associative array

//$data = json_decode($jsondata, true);

//

//get the employee details

$id = $data['customColumns']['totals'];

$name = $data['advertiserCost'];

$sql = "INSERT INTO db(another, one)

VALUES('$id', '$name')";

if(!mysql_query($sql,$con))

{

die('Error : ' . mysql_error());

}

?>

Skills: MySQL, PHP

See more: mysql database data matching, mysql database data xml feed, simple iphone app mysql database data, php, mysql, html, api, mysql database data collection, update mysql database data email, transfer mysql database data wordpress, mysql inserting data install script, copy mysql database data, fill mysql database data form, mysql database real estate script

About the Employer:
( 9 reviews ) Miami, United States

Project ID: #8988297

Awarded to:

Torricelli

Hi, i hope you're doing well. I've just read your project's description and i would like to help you with it. I'm an experienced web developer with the necessary skills for getting this job done. Responsibilit More

$25 USD / hour
(137 Reviews)
5.9

34 freelancers are bidding on average $29/hour for this job

kchg

Hello, I can do it shortly. More

$38 USD / hour
(417 Reviews)
9.5
krishdts

Greetings, This is Kris from DreamzTechUSA. Please open the chat room so we can discuss this in details. To get an idea of the quality of our work you can check the below link : [login to view URL] More

$33 USD / hour
(90 Reviews)
8.4
Chtioui86

Hi , I am expert web developer , i can do your script fast and in professional way . Price/Time will depend on detail I can start right now No payment until i finish your work . This My-sk-pe : [login to view URL] More

$39 USD / hour
(274 Reviews)
8.0
seekdeveloper

Hi, I have read your post and understood your requirement. I have great experience in handling /PHP/MySQL/HTML5/jQuery/Wordpress/Magento/Joomla/Drupal/AngularJS/node.js/CSS3/Java/Python/Django/Javascript/iOS/Andr More

$25 USD / hour
(104 Reviews)
8.6
searchtechnow

we are ready to start the work now. looking forward to hear from you.

$26 USD / hour
(353 Reviews)
8.2
sureshdevi

I can create php script to insert data into mysql database from API response. I will complete this work in next few hours. Looking for your reply to start this work immediately.

$25 USD / hour
(1083 Reviews)
7.9
gslogics123

Hello Sir I can do this right away. Please check my profile for work and experience. Regards Ashwin

$26 USD / hour
(266 Reviews)
7.4
Wangxianming

[login to view URL]'s me you are finding for. I have read your project with great care and I am sure I can do a perfect job for you. I have a experience in this side. If you hire me , I can provide top quality within your timelin More

$39 USD / hour
(14 Reviews)
6.9
vphat28

Hi I can modify your script right now to add data to database . I will need database connection information , access to database. Allow me to handle this for you.

$25 USD / hour
(170 Reviews)
7.0
MrMSparrow

A proposal has not yet been provided

$26 USD / hour
(66 Reviews)
6.4
sunnysmile911

Hi I have rich experience with web development. I built following websites. [login to view URL] [login to view URL] [login to view URL] If you give me the chance to do this, I'll do m More

$31 USD / hour
(28 Reviews)
6.3
kevalthacker

Dear Hiring Manager, How are you? I am able to do this work. I have more than 3 years of experience in PHP,MySQL. I am ready to start right now. Thank you. Regards, Keval Thacker

$32 USD / hour
(84 Reviews)
6.4
weonlydo

Hi, I have a bit of spare time on my hands now. Let's do this. Your script looks almost correct, it must be specific field names and mapping between JSON -> MySQL table that you are having trouble with. Happy to star More

$26 USD / hour
(78 Reviews)
6.3
freeworks

Hi, We are having 12 years experience in logo designing, web designing and [login to view URL] are expertise in PHP,WP,HTML5 . Please check our reviews and samples. I have lot of experience in PHP and JSON parser. P More

$27 USD / hour
(84 Reviews)
6.4
solafort

Hi. I am a skillful and talented PHP developer. I have more than 5 years experience in PHP/Mysql/Apache. I have proficient HTML/Javascript/HTML5/CSS/Bootstrap/jQuery/AngularJS skills too. If you want to check m More

$26 USD / hour
(16 Reviews)
5.8
stdhtelkom

Hello, I am very interested. I am very sure can help you completely and deliver the best for you. Thanks and all the best, Steve

$27 USD / hour
(33 Reviews)
6.1
logicalsoft

A proposal has not yet been provided

$30 USD / hour
(8 Reviews)
5.3
rodweb

Aucune proposition n'a encore été fournie.

$25 USD / hour
(46 Reviews)
5.5
rlo56467a9097547

Hoy my name is Rodrigo Im php developer for a long time I can help you if u chiste me Tks

$25 USD / hour
(39 Reviews)
5.3
worldinfosoft

Hello there, I have reviewed your job description as well and very confident to handle this project perfectly. I am expert in Web designing/developing.I believe that I can be the best productive candidate for More

$25 USD / hour
(14 Reviews)
4.9