php代码
MMM金融互助系统源码是以thinkphp为核心进行开发的3m金融互助平台。程序安装说明:1.恢复数据:将“数据备份”文件夹中的 urkeji.sql 文件请采用phpMyAdmin进行导入; 2.配置Sql数据库信息,文件路径:根目录下 config.php3.后台管理地址:http://域名/admin.php 用户名:100000 密码:admin1
0
<?php
mysql_connect('localhost', 'test', '123456');
mysql_select_db('test');
if(copy_table('products', 'products_bak')) {
echo "success\n";
}
else {
echo "failure\n";
}
function copy_table($from, $to) {
if(table_exists($to)) {
$success = false;
}
else {
mysql_query("CREATE TABLE $to LIKE $from");
mysql_query("INSERT INTO $to SELECT * FROM $from");
$success = true;
}
return $success;
}
function table_exists($tablename, $database = false) {
if(!$database) {
$res = mysql_query("SELECT DATABASE()");
$database = mysql_result($res, 0);
}
$res = mysql_query("
SELECT COUNT(*) AS count
FROM information_schema.tables
WHERE table_schema = '$database'
AND table_name = '$tablename'
");
return mysql_result($res, 0) == 1;
}
?>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号