Hey guys.. I did do searches on this topic, however, I still couldn't figure out how to get it to work. Any input will be very much appreciated.
I have some varable from php, say $php..
and I need to use that variable for a javascript.
eg:
switch($var)
{
case "1":
$result = mysql_query("select * from table WHERE ref='$var'");
while($row = mysql_fetch_row($result))
{
$php++;
}
break;
case 2: ....
<SCRIPT LANGUAGE="JavaScript1.2">
g.addRow("<?echo $php ?>;");
</script>
I tried to run this but all I see in the source file was
g.addrow(";");
and If I take out the ";" from the <?echo $php ?>, all I get is
g.addrow();
an empty variable returned..
what's wrong with this?