Pull Data from Custom DB with Customer Provided Info
-
Forgive any ignorance, I am learning this as I go along…
Here is my code so far:
global $wpdb; $customers = $wpdb->get_results("SELECT * FROM wp_sales_data WHERE CustomerNumber = 'XXXX' AND InvoiceNumber = 'YYYY'"); ?> <table class="table table-hover"> <?php foreach($customers as $customer){ ?> <tr> <td><center><?php echo $customer->InvoiceNumber; ?></center></td> <td><center><?php echo $customer->PartNumber; ?></center></td> <td><center><?php echo $customer->Quantity; ?></center></td> </tr> <?php } ?> </table>
I would like to create dialog boxes for the user to fill in their customer number, “XXXX”, and their invoice number, “YYYY”. To take a step further, it would be nice for the customer number to be prepopulated based on the users login. Specifically the meta_value stored in meta_key account_number in wp-usermeta.
Again sorry for the ignorance, but I am basically learning all this by trial and error and Google!
Thanks in Advance!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pull Data from Custom DB with Customer Provided Info’ is closed to new replies.