的表中删除旧有形象的名字hi2all我已经包含2场那样需要从数据库
TABEL |名称| imags _ | __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _ __ _
当用户在我的网站logined我注册这是名称在会议上,当他上传他的新照片
我想删除它的旧ph值oto并将他的名字设置为新照片如何做到这一点?
我的代码,以dB为单位插入每个上传的图片是作为下面我应该添加到我的
$me=$_SESSION['logged-in'];
$con=mysqli_connect("localhost","root","","register_form");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
@mysqli_query($con,"INSERT INTO imgs (name, imags)
VALUES ('$me', '$filename')");
mysqli_close($con);
,这里是我的代码,以显示它
<?php
$me=$_SESSION['logged-in'];
$con=mysqli_connect("localhost","root","","register_form");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT imags FROM imgs where name LIKE '$me' ");
while($row = mysqli_fetch_array($result))
{
$pathimg=$row['imags'];
$d = dir("image");
$entry = $d->read();
/*while (false !== ($entry = $d->read())) {
echo "<li><img src=\"/ConnectMe/html/image/" . $entry . "\">" . $entry . "</li>";
}
*/
}
mysqli_close($con);
echo"
<img width='50' height='60' src=\"/ConnectMe/html/image/$pathimg" . @$entry . "\">
";
你得到的错误是什么? – Awemo 2013-04-26 16:10:09