jemz Posted May 13, 2012 Share Posted May 13, 2012 Hi, I need some help,can i use input type="button" when deleting data in my database, Okay,this is how i made my code,i displayed all the records in the database using the Table,and i am using PDO.what i want is to click the delete button and this will redirect to the goDelete.phpand my problem in goDelete.php is i cannot displayed the idno and the name.Can you help me on this.Thank you in advance. while($fld = $count->fetch(PDO::FETCH_OBJ)) { ...... echo '<td>'.$fld->idno.'</td>'; echo '<td>'.$fld->Name.'</td>'; echo '<td><input type="button" name="delete" value="Delete" onclick="delete()"> </input></td>';} my script function delete(){ window.location.href="goDelete.php";} 1 Link to comment Share on other sites More sharing options...
dsonesuk Posted May 13, 2012 Share Posted May 13, 2012 echo '<td><input type="button" name="delete" value="Delete" onclick="delete('.$fld->idno.','.$fld->Name.')"> </input></td>'; function delete(thisidno, thisname){ window.location.href="goDelete.php?idno="+thisidno+"&name="+thisname;} in goDelete.php thisidno = $_GET['idno']; thisname $_GET['name']; Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now