Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
dbusher
Starting Member
7 Posts |
Posted - 2007-03-09 : 18:53:15
|
| I am very new to php. I am trying to use the following SQL query with php and I get an error:Parse error: parse error, unexpected T_STRING in ...myphp/MyCacheInfo.php on line 13 which is the $results line. Is my syntax wrong? the query runs fine when I use it directly against the db. <html><body><?php// Connects to your Databasemysql_connect("localhost", "name", "pword") or die(mysql_error());mysql_select_db("dbname") or die(mysql_error());//gather data$results = mysql_query("SELECT geocaches.cache_type as "Cache Type", COUNT(*) as "Traditional"FROM geocaches, logvisitWHEREgeocaches.cache_id=logvisit.cache_id ANDlogvisit.log_owner_id=64 ANDgeocaches.cache_type="Adult" ANDlogvisit.log_type="Found"GROUP BY geocaches.cache_type;")or die(mysql_error());printf($results)?></body></html> |
|
|
dbusher
Starting Member
7 Posts |
Posted - 2007-03-09 : 18:55:06
|
| oops...I meant to post this in a php forum :-) |
 |
|
|
|
|
|