3.2.0

javascript php call fails

I read the grid and build and set cookie in javascript then call php function to retieve cookie and process SQL as follows:-

<?php

...

function sql_update() {
if (isset($_COOKIE["sql"])) {
$sql = $HTTP_COOKIE_VARS["sql"];
$connection = @mysql_connect("localhost", 'x', x');
if (!$connection) {
die('Could not connect: ' . mysql_error());
}
@mysql_select_db(orders', $connection);
$result = @mysql_query($sql, $connection);
setcookie("sql",'',time()-3600);
if (!$result) {
die('Could not connect: ' . mysql_error());
}
mysql_close($connection);
echo $result;
}
}

...

?>
<html>
<head>
<script>

...

function savegrid() {
var sql = processgrid();
writeCookie(sql);
<?= sql_update() ?> !!! FAILS HERE !!!
}

Can someone please advise - Thanks
Andy
January 18,
try
<?php echo sql_update(); ?>
Pascale
January 19,
Pascale would you be so kind as to email me andyhill@axfite.com.au so I can discuss the error.
Andy
January 19,
ok ...:)
Pascale
January 24,

This topic is archived.

See also:


Back to support forum