| @@ 13-30 (lines=18) @@ | ||
| 10 | * @author xhelp development team  | 
                                |
| 11 | */  | 
                                |
| 12 | ||
| 13 | function smart_TableExists($table)  | 
                                |
| 14 | { | 
                                |
| 15 | $bRetVal = false;  | 
                                |
| 16 | //Verifies that a MySQL table exists  | 
                                |
| 17 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();  | 
                                |
| 18 | $realname = $xoopsDB->prefix($table);  | 
                                |
| 19 | $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;  | 
                                |
| 20 | $ret = $xoopsDB->queryF($sql);  | 
                                |
| 21 |     while (list($m_table) = $xoopsDB->fetchRow($ret)) { | 
                                |
| 22 |         if ($m_table == $realname) { | 
                                |
| 23 | $bRetVal = true;  | 
                                |
| 24 | break;  | 
                                |
| 25 | }  | 
                                |
| 26 | }  | 
                                |
| 27 | $xoopsDB->freeRecordSet($ret);  | 
                                |
| 28 | ||
| 29 | return $bRetVal;  | 
                                |
| 30 | }  | 
                                |
| 31 | ||
| 32 | /**  | 
                                |
| 33 | * Contains the classes for updating database tables  | 
                                |
| @@ 31-48 (lines=18) @@ | ||
| 28 | * @access public  | 
                                |
| 29 | * @author xhelp development team  | 
                                |
| 30 | */  | 
                                |
| 31 | function smartpartner_TableExists($table)  | 
                                |
| 32 | { | 
                                |
| 33 | $bRetVal = false;  | 
                                |
| 34 | //Verifies that a MySQL table exists  | 
                                |
| 35 | $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();  | 
                                |
| 36 | $realname = $xoopsDB->prefix($table);  | 
                                |
| 37 | $sql = 'SHOW TABLES FROM ' . XOOPS_DB_NAME;  | 
                                |
| 38 | $ret = $xoopsDB->queryF($sql);  | 
                                |
| 39 |     while (list($m_table) = $xoopsDB->fetchRow($ret)) { | 
                                |
| 40 |         if ($m_table == $realname) { | 
                                |
| 41 | $bRetVal = true;  | 
                                |
| 42 | break;  | 
                                |
| 43 | }  | 
                                |
| 44 | }  | 
                                |
| 45 | $xoopsDB->freeRecordSet($ret);  | 
                                |
| 46 | ||
| 47 | return $bRetVal;  | 
                                |
| 48 | }  | 
                                |
| 49 | ||
| 50 | /**  | 
                                |
| 51 | * Gets a value from a key in the xhelp_meta table  | 
                                |