Hello, this is my php code that I am using, and I think the issue might be lifecycle, but I am not certain on how to remedy.
if (isset($_POST['submit'])) {
$customer = $_POST['customer'];
if ($customer == 'All') {
echo "<strong>Please select a customer!</strong>";
}else{
if ($conn){
$result = sqlsrv_query($conn, $stmt, $params);
if ($result === false) {
echo "Error in execute stored procedure";
}
else {
?>
}
sqlsrv_free_stmt($result);
sqlsrv_close($conn);
}else{
echo "can't connect";
}
}
}
And I want to pass that variable to this JQuery function, but the echo does not print anything on screen.
<script>
$(document).ready(function () {
$("#download").click(function(){
<?php echo $customer ?>;
});
});
</script>