I have two tables - Players and Results
The Players table contains basic information about each player and is the date I want to be the base for my player_view.php page.
The results table contains 0 to 4 rows of data for each player with a test result for a year.
On the player view page, I want to display the details of each result record grouped by the year:
Player Name etc.
2007 Resultfield1 Resultfield2 Resultfied3
2006 Resultfield1 Resultfield2 Resultfied3
I am having no success bringing the results data onto the profile page. I tried following the example of Show list of customer orders example, but have not gotten anywhere.
I have the following code on the event page (one of many experiments):
// Put your code here.
echo "Your message";
//** Custom code ****
// put your custom code here
global $conn, $strTableName, $where;
$rs = db_query("select * from ".$strTableName." where ".$where,$conn);
$data = db_fetch_array($rs);
echo $data["field1"];
echo $data["field2"];
Which gives me this error:
Error type 256
Error description You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
URL localhost/nats/players_view.php?editid1=252539817
Error file C:\wamp\www\nats\include\dbconnection.php
Error line 26
I also threw in a Left Join in the sql query Left Join results ON players.player_pin = results.playerpin to see if I needed to bring this in before the event...wild guess.
So now I've got a bit of a muck and am not sure where to go next.
I can't use the master details, btw, because I need to display the records, not link to them -