<?php\r
/*\r
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-2009 The Nucleus Group\r
+ * Copyright (C) 2002-2010 The Nucleus Group\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
* Based on code in phpBB (http://phpBB.sourceforge.net)\r
*\r
* @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-2009 The Nucleus Group\r
+ * @copyright Copyright (C) 2002-2010 The Nucleus Group\r
* @version $Id$\r
* $NucleusJP: backup.php,v 1.8.2.1 2007/08/08 05:23:31 kimitake Exp $\r
*/\r
// catch all output generated by plugins\r
ob_start();\r
$res = sql_query('SELECT pfile FROM '.sql_table('plugin'));\r
- while ($plugName = mysql_fetch_object($res)) {\r
+ while ($plugName = sql_fetch_object($res)) {\r
$plug =& $manager->getPlugin($plugName->pfile);\r
if ($plug) $tables = array_merge($tables, (array) $plug->getTableList());\r
}\r
// add command to drop table on restore\r
echo "DROP TABLE IF EXISTS $tablename;\n";\r
$result = sql_query("SHOW CREATE TABLE $tablename");\r
- $create = mysql_fetch_assoc($result);\r
+ $create = sql_fetch_assoc($result);\r
echo $create['Create Table'];\r
echo ";\n\n";\r
}\r
\r
$fields = array();\r
for ($j = 0; $j < $num_fields; $j++) {\r
- $fields[] = mysql_field_name($result, $j);\r
+ $fields[] = sql_field_name($result, $j);\r
}\r
\r
/* }*/\r
//\r
// Grab the data from the table.\r
//\r
- $result = mysql_query("SELECT * FROM $tablename");\r
+ $result = sql_query("SELECT * FROM $tablename");\r
\r
- if(mysql_num_rows($result) > 0)\r
+ if(sql_num_rows($result) > 0)\r
echo "\n#\n# " . sprintf(_BACKUP_BACKUPFILE_TABLEDATAFOR, $tablename) . "\n#\n";\r
\r
- $num_fields = mysql_num_fields($result);\r
+ $num_fields = sql_num_fields($result);\r
\r
//\r
// Compose fieldname list\r
//\r
// Loop through the resulting rows and build the sql statement.\r
//\r
- while ($row = mysql_fetch_array($result))\r
+ while ($row = sql_fetch_array($result))\r
{\r
// Start building the SQL statement.\r
\r
// DEBUG\r
// debug("Executing: " . htmlspecialchars($sql) . "\n");\r
\r
- $result = mysql_query($sql);\r
- if (!$result) debug(_BACKUP_RESTOR_SQL_ERROR . mysql_error());\r
+ $result = sql_query($sql);\r
+ if (!$result) debug(_BACKUP_RESTOR_SQL_ERROR . sql_error());\r
\r
}\r
}\r