My 1st problem is I'm calling a function from javascript inside php(is my syntax correct, or is it possible to call that function),my 2nd problem is my query in mysql(the scenario is the value is incrementing, and there are values that are currently null )? I appreciate all the help that you could give, Thank you
<?php
echo "<input type='hidden' name='totalElements' value='".$counter."' />";
echo '<input type="button" value="Submit" onclick="javascript:document.getElementById("gtdb")/>';
echo('</form>');
?>
<script>
function gtdb()
{
$dbhandle = mysql_connect('localhost', 'root', '123456')
or die("Unable to connect to MySQL");
echo "Connected to MySQL<br>";
mysql_select_db("website_comment",$dbhandle)
or die("Could not select examples");
mysql_query("INSERT INTO comments(id, tag_name, comment,url_id)
VALUES ('',['$cke".$counter."'],'','','')")
or die("Could not select examples");
}
</script>