:: Forum >>

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
Monday, January 18, 2010
try
<?php echo sql_update(); ?>
Pascale
Tuesday, January 19, 2010
Pascale would you be so kind as to email me andyhill@axfite.com.au so I can discuss the error.
Andy
Tuesday, January 19, 2010
ok ...:)
Pascale
Sunday, January 24, 2010

This topic is archived.


Back to support forum

Forum search