I am trying to use a variable (calculated in Javascript) and then use it in a SQl query that I'll run in PHP.
My problem is that I can't figure out the syntax to use...I want to pass a Javascript variable into my SQL script
that I'll then run in PHP. And if this is not possible, what is another alternative?
This is the Javascript:
<form name="formName"><input type="text" name="textName"></form>
<script language="JavaScript"><!--
document.formName.textName.value = location.search.substring(1);
var sEventTitle = location.search.substring(1);
alert (sEventTitle);
//--></script>
This is the PHP/SQL: [This is the part that is not working]
<?php
$sql = "SELECT FROM tEvents WHERE Title = <script language='JavaScript'>sEventTitle</script>";
echo "sql = " . $sql;
$vQueryResult_1 = mysql_query($sql) or die($Err_msg_1 . " Error Msg = " . mysql_error() . $Err_msg_2 );
// ********************* END of Error Msg **********************
$login_check = mysql_num_rows($vQueryResult_1);
Etc....