php - How to Delete a row of a table with using Psedo-Class in MySQL -
i have created database table , table 1 column of varchar datatype.
now want delete rows without using
delete songs_list songs_name = 'shakira waka waka'
this because cannot write name of checkbox spaces. example:
<?php ($printedsno=1; $printedsno <$noio+1 ; $printedsno++){?> <?php while($row = mysqli_fetch_assoc($query7) ):?> <input type="checkbox" name="<?php echo "cb".$row['songs_name'];?>"/> <?php echo $printedsno?> <?php echo $row['songs_name']?></br> <?php break; endwhile; } ?>
here can not write checkbox name <?php echo "cb".$row['songs_name'];?>
why want use psudo-column. psudo-column can not able use clause beacause column does'nt exist.
i want delete row table column.
<?php include 'database.php'; $noofsongs = "select * songs_list"; $query8 = mysqli_query($con, $noofsongs); $noio = mysqli_num_rows($query8); $flag = 0; $del = 0; $row = mysqli_fetch_assoc($query8); $song_names = $row['songs_name']; if(isset($_post['deletethis'])){ for($j=1; $j<=$noio ;$j++){ while($row = mysqli_fetch_assoc($query8) ){ if (isset($_post['cb'.$song_names])){ $deletesongsquery = "delete `songs_list` `songs_name` = $song_names" ; $query4 = mysqli_query($con, $deletesongsquery); if($query4){ $del++;} $flag = $flag + 1; } } } if($del != $flag){echo "can not deleted selected songs.";} else{echo "deleted $del selected songs.";} } ?>
can me in this??
Comments
Post a Comment