2016-01-21 118 views
0
categories Object 
(
    [_db:categories:private] => db Object 
     (
      [_pdo] => PDO Object 
       (
       ) 

      [_query] => PDOStatement Object 
       (
        [queryString] => SELECT * FROM categories WHERE name_of_category = ? 
       ) 

      [_error] => 
      [_results] => Array 
       (
        [0] => stdClass Object 
         (
          [id] => 10 
          [name_of_category] => Vedran 
          [description_of_category] => adsdasdas 
          [meta_keywords] => sadasdas 
          [meta_description] => asdasdas 
          [notes] => sadsadas 
          [created] => 2016-01-20 08:26:02 
         ) 

        [1] => stdClass Object 
         (
          [id] => 9 
          [name_of_category] => VEdran 
          [description_of_category] => ddddd 
          [meta_keywords] => qsqddd 
          [meta_description] => sqdddd 
          [notes] => sddd 
          [created] => 2020-01-16 00:00:00 
         ) 

       ) 

      [_count] => 2 
     ) 

    [_fields:categories:private] => 
) 

你好。有人可以幫助我與這個陣列。我已經在數據庫分類表中創建。我想在用戶可以管理類別的頁面上顯示類別(刪除,編輯)。當我想從數據庫中顯示類別時,我在PHP中獲取這個數組。現在我不知道如何僅在網頁上顯示「name_of_category」。有人可以幫幫我嗎。多維數組顯示數據

+0

什麼是你的代碼來查詢數據庫? –

回答

1
$categories=$ObjVariable->_results; 

然後使用$類別排列顯示值