Feartheyankees
07-24-2012, 06:45 AM
Hey guys, basically what I'm trying to do is display a form, and when a user updates the textbox, it'll automatically query the database to update it. Might save some time then pressing submit over and over again, why not try it.
<script type="text/javascript">
function submitform(id,fieldname,formname) {
var newfield = document.forms[formname].elements[fieldname].value;
<?
mysql_query("UPDATE pilots SET; "?> +fieldname+ <? " = "; ?> +newfield <?" WHERE id = ";?> +id+"");
?>
}
</script>
I'm not sure if this idea is possible, but I want to see if maybe I just have invalid syntax in the mysql_query.
<script type="text/javascript">
function submitform(id,fieldname,formname) {
var newfield = document.forms[formname].elements[fieldname].value;
<?
mysql_query("UPDATE pilots SET; "?> +fieldname+ <? " = "; ?> +newfield <?" WHERE id = ";?> +id+"");
?>
}
</script>
I'm not sure if this idea is possible, but I want to see if maybe I just have invalid syntax in the mysql_query.