Formatting Tables

Discussion in 'PHP' started by Jamie, Oct 20, 2017.

  1. Jamie


    Oct 20, 2017
    Likes Received:
    Hi there,
    I have a wordpress custom table, fields are id,category,question,frmname
    what i need to have a layout of

    CAT1 |CAT2 |CAT3 |CAT4 |CAT5
    c1Q1 | c2Q2 | c3Q3 | c4Q2 | c5Q1
    c1Q2 | c2Q3 | c3Q4 | c4Q3 | c5Q2
    c1Q3 | c2Q4 | c3Q5 | c4Q4 | c5Q3
    c1Q4 | c2Q5 | c3Q6 | c4Q5 | c5Q4

    so i have
    global $wpdb;
    $questions = $wpdb->get_results("select * from wp_pods_questions");

    foreach ($questions as $question){
    //this is where i am unsure how to get it to format correctly......

    any help would be great thanks
    Jamie, Oct 20, 2017
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.