I'm almost done, this is what I'm doing
my table has 3 fields indexed separately
date, unit, code
<?php
$flag = toread();
//function toread
$sql = "SELECT * FROM table .
WHERE date = " . "'" $var1 . "'" .
" AND unit = " . "'" . $var2 . "'" .
" AND code = " . "'" . $var3 . "'";
$result = mysql_query($sql);
return mysql_num_rows($result);
//retrieve data into variables
?>
<html>
...
<script javascript>
var var1 = '<?php print "$flag"; ?>'
if (var1 == 0)
alert(msg)
else
getdata()
...
well the problem is that the same
SELECT sentence, works fine in a
small htmtest, but in the above example
I always receive var1 = 0...
Even when issue an INSERT,
(and the record is generated)
the flag is always 0...
I use javascript because
I need to keep the data in memory
for other tasks, visualization in html
is less important in this case
what do you suggest?