crack576 Posted November 20, 2014 Share Posted November 20, 2014 <body> <?php include 'sql.php'; $query = "SELECT * FROM validation"; $result = mysqli_query($con , $query); $rows = mysqli_fetch_assoc($result) ; $totals = mysqli_num_rows($result) ; ?> <div id="css"> <form > <table width="80%" border="0" cellpadding="2" cellspacing="2" > <caption><h2>Personal Details of Customers</h2></caption> <tr class="white"> <td bgcolor="#330033"> </td> <td bgcolor="#330033"> Id Number </td> <td bgcolor="#330033"> Full Name </td> <td bgcolor="#330033"> Email Address </td> <td bgcolor="#330033"> Website </td> <td bgcolor="#330033"> Comment </td> <td bgcolor="#330033"> Time </td> </tr> <?php while($rows=mysqli_fetch_assoc($result) { <tr> <input type="raido" name="ID" value="<?php echo $rows['ID']; ?>" /> <td bgcolor="#FFFFCC"><?php echo $rows['ID'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Name'];?> </td> <td bgcolor="#FFFFCC"><?php echo $rows['Email'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Website'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Comment'];?></td> <td bgcolor="#FFFFCC"><?php echo $rows['Time'];?></td> <td> </td> <td> <a href="delete.php? ID= "$rows[ID]" /"> <input type="submit" name="del" value="Delete" /> </a> <input type="button" name= "edit" value="Edit" /> </td> </tr> } ?> </table> </form> </div> </body> Quote Link to comment https://forums.phpfreaks.com/topic/292597-problems-with-my-while-loop-and-also-cant-delete-its-corresponding-rows-on-a-click-of-the-buttton-delete/ Share on other sites More sharing options...
requinix Posted November 20, 2014 Share Posted November 20, 2014 It'd be nice if you spent the bit of time it takes to write a description of your problem, rather than just use the one-line title to cram everything in. Leaves us with questions like "What problems with your while loop?" As for the other issue, Putting aside the malformed HTML, You can't put a button inside a link. Pick one. However if you need to pass a value then you can use a like DeleteTo make that work, though, you need the current script (the one that handles editing) to support deletes too - can't have a form inside a form, and shouldn't try to switch the action of a form based on a button. There's HTML 5 stuff you could do, actually, but I probably wouldn't. Quote Link to comment https://forums.phpfreaks.com/topic/292597-problems-with-my-while-loop-and-also-cant-delete-its-corresponding-rows-on-a-click-of-the-buttton-delete/#findComment-1497128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.