Firstly, any idea why the following code doesn't work?
It is meant to get a list of scorers for a particular match, and then
go to another table and get the short version of a players name.
if (! isset($news_index) ) {
$news_index = 0;
}
$sql = "SELECT id,player,time FROM
fixtures_scorers WHERE team ='$team3' AND id='$date'";
$result = mysql_query($sql);
$row = mysql_num_rows($result);
$i = 0;
while ($i < $row) {
$i = $i + 1;
$myrow = mysql_fetch_array($result);
$player =
stripslashes($myrow["player"]);
$time = stripslashes($myrow["time"]);
$result = @("SELECT id FROM fixtures WHERE name='$player'")
or die ("That didn't work :-)");
$playername = @mysql_result($result, 0, "id");
print "$playername $time, "
;}
For some reason only the first value is printed.
Secondly, last night Tottenham beat Stevenage 8-1 in a football match in England. If I was to get the
above code working, it would look like this:
Poyet 9, Ferguson 21, Poyet 28, Poyet 30, Ferguson 38, Freund 77,
Kamanan 80, Kamanan 84
Would there be any way of getting it to look like this:
Poyet 9,28,30 Ferguson 21,38 Freund 77 Kanaman 80,84
Any help would be greatly appreciated.