Run PHP code inside JavaScript? Would this be ok to use?

genevievedove

New Member
I am not sure if a line of PHP could be run inside of a JavaScript function. For example:\[code\]<script language=javascript>var int=self.setInterval("message()",1000);function message() {<?PHP mysql_query("SELECT * FROM example"); ?> }</script>\[/code\]I haven't tried to run this, but I don't think you can run PHP like this. Could anyone help. Could i run a PHP script inside a javascript function somehow without using a call to an outside PHP file through Ajax?
 
Back
Top