Hi
I have the following code:
function deletecoord()
{
<?
$string = mysql_query("SELECT coord_index FROM imagecoord ORDER BY coord_index DESC LIMIT 0,1");
mysql_query("DELETE FROM imagecoord WHERE coord_index = $string");
?>
}
The above is called from a hyperlink with an onclick event pointing to the javascript/php function.
As I am a complete newbie to this can anyone tell me what I am doing wrong?
I should be simply deleting the last entry in the imagecoord table once the user clicks on the hyperlink.
I believe I am doing something wrong with the mysql_query functions, but am unsure what!
I have tried an "alert (<? $string ?>)" but it returns a blank alert box.
Any help would be appreciated.