SET @mycnt=0;
SELECT @mycnt := @mycnt +1 as mycnt, a.*, b.*
FROM a, b;
表中第一列即为mycnt,从1开始计数。
set @num=0;select concat('update apl_maps_biz set gkid=\'',gkid,'\' where id=',@num := @num +1,';' ) from ca_map_buzman;
1、cp path/mysql/data/your database path/mysql/data/
2、cp path/mysql/ibdata1 ib_logfile0 ib_logfile1 path/mysql //覆盖
3、 ERROR 1018 (HY000): Can't read dir of './your database/' (errno: 13)
解法方法: #chown -R mysql:mysql /path/mysql/your database
<?php
include("config.php");
if($_GET["id"])
{
$_GET["id"]=inject_check($_GET["id"]);
echo $id;
}
function inject_check($sql_str) {
$check= eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file
|outfile', $sql_str);
if($check)
{
echo "非法字符!";
exit();
}else
{
return $sql_str;
}
}
?>
1. use database;
2.set character set utf8;(eg: GBK)
3.source example.sql (sql文件路径)