Home » Database » DB_Table » Bug #5679
Warning if no table-index defined
Details
| Submitted | 2005-10-13 07:18 UTC |
|---|---|
| From | arne dot bippes at brandao dot de |
| Assigned | wiesemann |
| Status | Closed |
| Package | DB_Table |
| PHP Version | Irrelevant |
| OS | irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-10-13 07:18 UTC] arne dot bippes at brandao dot de
Description:
------------
Defining a new table without an index set, leads to a PHP-Warning:
Warning: Invalid argument supplied for foreach() in /home/arne/public_html/bdoproject/bdolib/pear/DB/Table/Manager.php on line 144
Expected result:
----------------
No Warning: Don't run into the "validate index" function if no index is defined.
[2005-10-27 08:59 UTC] arne dot bippes at brandao dot de
Hi Mark,
sorry, the problem is kind of self made. I was building the col,idx,sql-Array dynamically. Therefore the $idx was set but null (var $idx;). This is when you get the warning. As you found out, if you just don't use the variable no warning appears.
Therfore I guess this is nothing you have to worry about as i will manage it in my application.
Another topic:
We spent some efforts on developing a 'change' class - which will check the col-array against the db-table and adds new columns. This class extends your DB_Table_Manager. If you are you interested, please contact me.
Arne