原帖由 lowpostz 于 2011-4-12 13:17 发表
require_once 'db_config.php';
//转换到string
$sql = "SELECT * FROM [tablename1]";
$res = mysql_query($sql);
while($row = mysql_fetch_assoc($res))
{
$name = $row['name'];
$time = $row['time'];
$info = $row['Info'];
$description = strstr($info, "DESCRIPTION:");
$info = strstr($info, "DESCRIPTION:", true);
$location = strstr($info, "LOCATION:");
$info = strstr($info, "DESCRIPTION:", true);
$summary = strstr($info, "SUMMARY:");
$info = strstr($info, "SUMMARY:", true);
$sql = "INSERT INTO [tablename2] (name, subject, description, time, location) VALUES ('$name', '$summary','$description','$time', '$location')";
$res_insert = mysql_query($sql);
}
修改一下,
不过出来的答案还是有点不对哦 |