I have a Javascript variable as "name" I want to add that to my php code. The php code uses the JS variable for a select statement. This is what I am Trying, but I am getting a syntax error;
<script type="text/javascript">
function fillform(name){
<?php $name = "SELECT * FROM table_name WHERE name = ". ?> name <?php ." "; ?>
console.log(<?php echo $name; ?>);
}
</script>