hi
i design websit to view images
i want when admin click on the image image will be deleted
how i do that
??
this my code
<head>
<script type="text/javascript" >
function vvvv($id,$im)
{
if(confirm("are you sure want delet this imagej?"));
$b=true
if($b)
{
<?php
mysql_connect ('localhost', 'root');
mysql_select_db("pickapic");
$myquery="Delete FROM photo WHERE Pid=$id";
mysql_query($myquery);
?>
}
}
</script>
</head>
<body>
<?php
print("<table width=40% border=0 align=center>");
mysql_connect ('localhost', 'root');
mysql_select_db("pickapic");
$result2= mysql_query("SELECT Pname FROM photo");
$result = mysql_query("SELECT Pid , link FROM photo");
$count=0;
while($row = mysql_fetch_array($result))
{
if ($count==0)
print("<tr>");
$image=$row["link"];
$id=$row["link"];
print ("<td><img src=\"file:///C|/xampp/htdocs/PickaPic/admin/img/$image \" width=\"150\" height=\"150\" border=\"0\" onClick=\"vvvv('$id','$image')\"; ></td>");
$count=$count+1;
if($count == 5 )
{
print("</tr>");
print("<tr>");
for($i=0; $i<5 ; $i=$i+1)
{
$row2= mysql_fetch_array($result2);
$name1=$row2["Pname"];
print("<td><div align=\"center\"><span class=\"style6\"> $name1 </span></div></td>");
}
print("</tr>");
$count=0;
}
}
print("</table>");
?>
</body>
</html>
thx :):):)