Thursday, December 1, 2022
HomeWordPress Developmentwp question - Learn how to add a number of queries into...

wp question – Learn how to add a number of queries into single foreach


Im making an attempt so as to add a number of queries in foreach. Is that this potential?

The queries:

<?php
    world $wpdb;


    $Company_ID = $wpdb->get_results("SELECT Company_ID FROM Central_Company");
    $Students_Name = $wpdb->get_results("SELECT First_Name, Last_Name FROM Central_Student");
    $Date = $wpdb->get_results("SELECT Date FROM Central_ClassDate");
    $Location = $wpdb->get_results("SELECT Location_Name FROM Central_Class_Location");

The foreach loop with solely $Company_ID working:

 foreach($Company_ID as $COMPANY_ID) 
    {
                  echo '<td>';
                  echo $COMPANY_ID->Company_ID;
                  echo '</td>';
    };
    

    
?>

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments