Jump to content

Sending Query with a link


Unrated

Recommended Posts

This is probable a stupid question but oke :) I want to delete a certain datablock in the database by clicking a url!

<?phpinclude "connect.php";$query = "SELECT * FROM `upmatch`";$sql = mysql_query($query) or die ( mysql_error( ) );$querydel = "ALTER TABLE `upmatch` DROP `qsd`";$sqldel = mysql_query($querydel) or die ( mysql_error( ) );while($record = mysql_fetch_object($sql)){echo"<tr><td>".$record->team1." - ".$record->team2."</td><td>".$record->map."</td>   <td>".$record->date."</td><td>".$record->time."</td><td><a href="" alt="">Delete</a></td></tr>";}?>

I want the "$sqldel" to be executed when i click Delete! But i dont know what to add between the <a href="">Delete</a> tags..

Link to comment
Share on other sites

This is probable a stupid question but oke  :) I want to delete a certain datablock in the database by clicking a url!But i dont know what to add between the <a href="">Delete</a>  tags..

I dont know about php but it might be same as aspSo i m giving solution as per ASP, hope it will workMove your query to other page say "Delete.php"and on the clik of "DELETE" call this page.<a href="Delete.php">Delete</a>
<?phpinclude "connect.php";$querydel = "ALTER TABLE `upmatch` DROP `qsd`";$sqldel = mysql_query($querydel) or die ( mysql_error( ) );'''''' Here redirect this page to previous page?>

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...