WordPress.org

Forums

query a product list from mysql (3 posts)

  1. marlon118
    Member
    Posted 2 years ago #

    How can i query a product list from mysql and display the items?

  2. Justin Greer
    Volunteer Moderator
    Posted 2 years ago #

    Look into $wpdb

    Then you can use the class to do a SQL query

    Exmaple:

    global $wpdb;
    $results = $wpdb->query(SELECT * FROM table_name WHERE blah blah bah);

    Then you can return the object just like you would a normal MySQL query (as object and not array)

  3. marlon118
    Member
    Posted 2 years ago #

    okay, I'm not too familiar with this. This is an example of what I want to do

    http://www.mivila.com/products.php

    they list the product categories then you can click on one and it lists the items in that category. I've made a new table in mysql database called plist and I uploaded the CSV file.

    I don't really know what to do from there

Topic Closed

This topic has been closed to new replies.

About this Topic