:: Forum >>

How to delere an sql record clicking by a button ?

How to delere an sql record clicking by a button using php + sql

For ex: let say i have 23 record in my data base
and i wanna show all and after that i wanna delete record nr. 5

With just a click on a button "delete"
michael
Thursday, August 18, 2005
You'll write an onclick event that will return the row values to you. You'd need a unique identifier for the row (like a unique ID)

Once you have the unique ID, you can use XMLHttp to run a PHP file and pass it that value. The PHP will then delete the record out of the database.

ie,

1) On click/select of a row, return the unique value of the row you clicked (normally into a hidden field)
2) Use XMLHttp to get Javascript to execute a server side script (could be ASP,PHP etc) and pass it that value.
3) You server side script would then delete the record out of the database based on the value you passed to it.

Good luck
AcidRaZor
Friday, August 19, 2005
Hey AcidRaZor,

Thanks for the tip... but I don't know XMLHttp... where would i start learning to use it? Could you at least illustrate to me how it works and how to do it?...


thanks
glennlosentes
glennlosentes
Wednesday, August 24, 2005
I dont know, google xmlhttp ;)
AcidRaZor
Thursday, August 25, 2005
Search in forum on XMLHTTP is a good start and find examples google has som searching facilities...
John Ophof http://open-modeling.sourceforge.net
Thursday, August 25, 2005

This topic is archived.


Back to support forum

Forum search