• 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?
    thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Does it give you an error or anything of the kind?

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

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with creating new db table’ is closed to new replies.