javascript in php: Document.forms not function -
in php:
if (isset($close_subject)) { $sql_close = "delete content_tree user_id='$id' , subject_id='$close_subject'"; $result_close = mysql_query($sql_close); } function xxx() { <a href="#" onclick="closesubject('<? echo $set_subject[subject_id] ?>')"><img border="0" align="absmiddle" src="../../pic/tree/open.png"></a> }
in html:
xxx(); <script type="text/javascript"> function closesubject(id) { document.close_subject_form.close_subject.value = id; document.close_subject_form.submit(); } </script> <form name="close_subject_form" method="post"> <input type="hidden" id="close_subject" name="close_subject"> </form>
hi, have codes above. wan delete record in database. not function >.< can help?
function deleteshit($id,$close_subject){ mysql_query("delete content_tree user_id='".mysql_real_escape_string($id)."' , subject_id='".mysql_real_escape_string($close_subject)."'"); return mysql_affected_rows(); }
also, if, contrary best guess, have idea you're doing, check out shit http://wiki.hashphp.org/pdo_tutorial_for_mysql_developers
Comments
Post a Comment