<?php
include ("connect.php");
[email protected]($_GET['id']);
[email protected]_query("select * from tipuranibasti where id = $id");
[email protected]_fetch_assoc($image);
[email protected]$image_row['name'];
[email protected]$image_row['date'];
[email protected]$image_row['msg'];
$image=addslashes(@file_get_contents($image_row['image']));
if(@mysql_query("insert into puranibasti values('','$name','$date','$msg','$image')"))
{
echo "image has been inserted successfully";
} else
{
echo "problem inserting the image";
}
?>
1 IM能够从tipuranibasti将所有数据表puranibasti除了图像可以请人帮如何将图像数据从一个表格移动到另一个表格?
不插入到puranibasti选择'',名称,日期,味精,从tipuranibasti图像id = $ id'工作? – 2011-12-25 21:51:46
请使用PDO准备好的查询,或者至少使用'mysql_real_escape_string'。 'addslashes'不足以防止SQL注入。 – mc10 2011-12-25 21:55:14
抑制错误是一种可怕的做法,请创建一些错误处理,这并不难。 – Maerlyn 2011-12-26 18:16:10