No that is not your $api_results, is it? Again that is invalid json, when i fixed it i got the same result you did. If you lie to us why do you expect to get valid advice?

And you dont follow instructions well do you? you changed THREE major parts of what i had posted, resulting in a whole different result from what you would have gotten if you had just cut & pasted what i wrote.

but not knowing what jg did, i misinterpreted part of what was needed to make this work, so i included the fix in this version. See if you can figure out what you did wrong and why was it wrong from what i had first posted. Then try to figure out what i did to simulate how jg worked. But i suspect both tasks are beyond your abilities.

$app_insert = $dbh->prepare("INSERT INTO bitium_apps(id, app_slug, app +_Name, team_id, provider_id, provider_slug, provider_saml, config_saml, confi +g_login, config_url, created_date, status, key_vault, mfa_code, configuration_i +nstall) VALUES (?, ?, ?, \"$response\", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?") o +r die $dbh->errstr; use JSON; my $json=new JSON; my $unjson=$json->allow_nonref->decode($api_results); for my $row (@$unjson) { my @insert; for my $var (qw/.id .slug .name .provider.id .provider.name .provider.capabilities.has_saml .configuration.sam +l .configuration.login .configuration.url .created_a +t .status .key_vault .requires_mfa_code .configurati +on.install_type /){ my $var2=substr($var,1); my @parts=split('\.',$var2); my $base=$row; my $terminal=pop @parts; while (scalar(@parts)>0) { my $subpart=shift @parts; $base=$base->{$subpart}; } push @insert,$base->{$terminal}; } # var $app_insert->execute(@insert[0,1,2,4 .. 15]) or die $app_insert->e +rrstr; } # row
Dont screw up again, and try to learn about what you are doing rather than just trying to get someone to do it for you


In reply to Re^7: Perl Database Entries by huck
in thread Perl Database Entries by cbtshare

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.