Skip to content

Import Variables from database #2

@ZainSohail

Description

@ZainSohail

Okay, so I am not much of an expert when it comes to jQuery. So I though maybe someone could help me out a bit.

WHAT I AM TRYING TO DO:
I need to get these entries to the template, so that I could populate the graph.

Currently the graph is populate by variables which are acquired through QuantiModo API. I figured it out where it is initializing them but I couldn't find out how to use this var to use my database entries.

Used Here: https://github.com/Abolitionist-Project/QM-Personal-Studies-Plugin/blob/master/themefiles/js/bargraph_charts.js#L4

Initialized Here: https://github.com/Abolitionist-Project/QM-Personal-Studies-Plugin/blob/master/themefiles/js/libs/quantimodo-api.js#L137

I also tried to import the entries to a PHP function and then adding them to the 'variableName', but it didn't work. Here is what I tried ..

<?php 
global $wpdb;
$postid = $wpdb->get_results('SELECT post_id FROM qm_postmeta');
$metaid = $wpdb->get_results('SELECT meta_id FROM qm_postmeta');
$metakey = $wpdb->get_results('SELECT meta_key FROM qm_postmeta');
$metavalue = $wpdb->get_results('SELECT meta_value FROM qm_postmeta');
$currentpostid = get_the_ID();

if(!empty($metavalue)) {
      while($postid == $currentpostid){
        $metavalue = $variable['variableName'];
        return $variable;
      }
}
?>

@dinomov @mikepsinn

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions