Hi,
I tried the new code, and I get a php parse error on line 4.
One thing to keep in mind are my data types,
both country and state are varchar(15).
<?
require("dbinfo.inc.php");
sql="select state, count(state) as cntState //<-- Line 4
from table1
where country='US'
group by state";
$result = mysql_query($sql) or die(mysql_error());
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php while ($row=mysql_fetch_array($result)) {
echo "number of entrants in $row['state']: $row['cntState']<br>";
} ?>
</body>
</html>
At first I put your code, but then I got an error, so I then put the query in a SQL variable, but still I got the same error.
any idea what's going on?
dbinfo.inc.php is of course the connection strings.
Thx