2. Simple Data read from Database

  public function getAll($table){
        $query = mysqli_query($this->connect,"SELECT * FROM $table");
        if(mysqli_num_rows($query)>0){
          return mysqli_fetch_all($query,MYSQLI_ASSOC);  
        }
        else{
            return "No data avaible in your $table Table";
        }
    }

echo "<pre>";
print_r($obj->getAll("members"));

Show this like following screenshot:
data-read

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s