|
-
Feb 4th, 2003, 11:35 AM
#1
Thread Starter
Registered User
i want delete checked rows to be deleted
i have one checkbox in each row i want delete those which are checked(like as we see yahoo site deleting unwanted messages by checking some checkbox) i have code for this but its not wroking so please help me.
$sql="select * from product_info order by product_name limit 0,$i";
$r=mysql_query($sql);
$rc=mysql_num_rows($r);
if ($rc>=1)
{ ?>
<table border=1 align=center>
<tr><td>select</td><td>item number</td><td>Description</td><td>price</td></tr>
<? while($qw=mysql_fetch_array($r))
{ ?>
<tr><td><input type="checkbox" name="check[]" value=<?=$qw["product_id"]?>></td>
<td><?=$qw["product_id"]?></td>
<td><?=$qw["product_description"]?></td>
<td><?=$qw["product_price"]?></td></tr>
<?}?>
<?} }?></table><br>
<? if($mode="delete" && count[$check]>=1){
for ($j=0;$j<=count[$check];$j++ )
{
if($check[$j]!=""){
$sql= "delete from product_info where product_id=".$check[j]
mysql_query($sql); }
}?>
<a href="javascript:;" onclick="checkcount()">
ON PRESSING THIS HYPERLINK IT SHOULD
DELETE
<script language="Javascript">
function pagecount(j)
{
if(j!=0)
{
f.action="index1.php?i="+ j +"";
alert(f.action);
f.submit();
}
}
function checkcount()
{
var obj=document.f;
obj.submit();
alert("asd");
}
</script>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|