I'm having trouble trouble trying to call a function from a html button. I've got this code:
HTML:
<input type="button" value="Do it" onClick="sv()" />
PHP:
function sv(){
$sqlqueryadd = "UPDATE general_list SET nes=2 WHERE nes=1 AND id=100";
$sqldoadd = mysql_query($sqlqueryadd) or die(mysql_error());
}
JS:
function sv() {
var x="<?php sv(); ?>";
alert(x);
return false;
}
This obviously doesn't work, only alerts the "sv();" code.
Thanks a lot!