I found this tip on this site.
http://www.phpbuilder.com/tips/item.php?id=529
I am trying to count the number of records and display it on my index.html page.
I found this tip and thought it would work perfectly. But I can't get it to do anything.
I created the php file called getrows.php Obviously I removed the real user/passwords and domain name.
here is the php code
<?PHP
$user="username";
$password="mypassword";
$database="mydbname";
$hostname="localhost";
mysql_connect($hostname,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
// get data from database
$querystr = "SELECT * FROM schedule"
$query=mysql_query($querystr);
// store formatted data into a variable
$result=mysql_query($query);
$numrows=mysql_numrows($result);
mysql_close();
?>
<!-- Hide from non JS enabled browsers
// Use JavaScript to write content to screen
document.write('<?PHP echo test. $numrows; ?>');
//--> End Hide
then I put the following code in the html
<script language="Javascript" type="text/javascript"
src="http://www.mydomain.com/getrows.php"></script>
But when I view the page no number displays and no "test" either.
Thanks for any help