dynamic input box to update insert and delete in my sql

Coeltetly

New Member
I have a simple form but I want to dynamically change the form action from insert to update in same page and I want to show the values in the same page. I have written update in \[code\]href\[/code\] link. Please help me.\[code\]<?php$username="root";$password="";$database="test"; include"db.inc.php"; $order = "SELECT * FROM tablename1"; $result = mysql_query($order); while ($row=mysql_fetch_assoc($result)){ echo ("<tr><td>$row[sno]</td>"); echo ("<td>$row[name]</td>"); echo "<td ><a href=http://stackoverflow.com/"test.php?id=".$row['sno'] . "\" onclick=\"return confirm('Are you sure you want to edit datas?');\">Edit</a></td>"; echo "<td><a href=http://stackoverflow.com/"insert1.php?id=".$row['sno'] . "\" onclick=\"return confirm('Are you sure you want to delete?');\">Delete</a></td></tr>"; }?>\[/code\]
 
Back
Top