• michaelsrpersaud

    (@michaelsrpersaud)


    Hey Guys,

    I ran a query against my database as follows:

    $table_name = $wpdb->prefix . “xyz”;
    $sql = “SELECT * FROM ” . $table_name ;
    $pageposts = $wpdb->get_results($sql, ARRAY_N);
    print_r($pageposts);

    This works but when i’m trying to extract the data from the query i am stuck

    Data looks like this (looks multidimensional to me)
    Array ( [0] => Array ( [0] => 123 [1] => 1 [2] => 1 [3] => 2 [4] => 0 [5] => 0 [6] => Whales [7] => 0 [8] => 0000-00-00 ) )

    What i would like to do is to be able to build an html table with an edit button at the side but if someone can guide me through being able to extract the data from the query e.g. field one “echo $pageposts ->id; or other i think i can figure the rest out.

    Thanks in advance

    Mike

  • The topic ‘Extracting datatable’ is closed to new replies.