trying to put api data in database with php?
I'm pulling deals from Groupon's api, and I have no clue how to take the
data and put it into a database with php, i know how to show it on in
html, but not in the database, I need to pull it into the database so I
have more control over the info, if anybody knows how to do this or knows
a better way, i'm all eye's, lol, thanks
<script type='text/javascript'>
$(function () {
$.getJSON("https://api.groupon.com/v2/deals.json?callback=?",
{
    client_id: "b252ad3634a4ab2985b79d230ccc4e49a3ea9d19",
    show: "all",
    division_id: "los-angeles"
})
.done(function (data) {
    console.log(data);
    // do whatever processing you need to do to the data
    // right here, then drop it in the div
    $.each(data.deals, function (i, v) {
        $title = $("<h2/>", {
            html: v.title,
            class: "heading"
        });
        $img = $("<img/>", {
            src: v.mediumImageUrl
        });
        $deal = $("<div/>", {
            html: v.highlightsHtml + v.pitchHtml
        });
        $("#main").append($deal);
        $deal.prepend($title, $img);
    });
});
});
</script>
 
No comments:
Post a Comment