Problem with creating new db table (3 posts)

  1. carmelneta
    Posted 3 years ago #

    Hey fox,
    I'm having some issuse when trying to work with a new table on wpdb
    I've created a new table on phpmyadmin, but when trying to pull out data noting comes out:
    table holding one column named "id".

    global $wpdb;
       $nun= $wpdb->get_results(
       SELECT *
       FROM $wpdb->fet_users
      foreach ( $nun $nuna)
          echo $nuna->id;
          echo "<br />";

    Any ideas?

  2. Does it give you an error or anything of the kind?

    What does it show if you do:
    var_dump( $nun ); exit; ?

  3. Spencer Cameron
    Posted 3 years ago #

    For starters, you're missing the as in your foreach.

    Like this:

    foreach( $nun as $nuna ) {
        // Make things happen.

    Was that just a typo when you entered it here or is that in your code? If it is, you should be getting a parsing error and/or a white screen.

Topic Closed

This topic has been closed to new replies.

About this Topic