Hello i have been running a fantasy football site for 7 years with this code but it is failing now with an error, Why!
can anyone please help because its been so long since ive used php
<?php
function build_league_table($teamname) {
$connection = mysql_connect($host, $user,$password) or die ("Couldn't connect to server.");
$db = mysql_select_db($database, $connection) or die ("Couldn't select database.");
$sql = "SELECT a.id, a.name, a.team, a.price, a.points, c.NEW_POINTS, ";
$sql .= "IF (c.NEW_POINTS IS NOT NULL , a.points - c.NEW_POINTS, a.points) AS 'REAL_TOTAL', ";
$sql .= "IF (c.NEW_POINTS IS NOT NULL, 'SUB', 'NOTSUB') AS 'SUBQ' ";
$sql .= "FROM teams b, dreamteam a ";
$sql .= "LEFT OUTER JOIN subs2 c ON c.NEW_ID = a.ID ";
$sql .= "AND b.team_name = c.team_name ";
$sql .= "WHERE b.team_name = '$teamname' ";
$sql .= "AND a.id ";
$sql .= "IN (b.player_1, b.player_2, b.player_3, b.player_4, b.player_5, ";
$sql .= "b.player_6, b.player_7, b.player_8, b.player_9, b.player_10, b.player_11) ";
$sql .= "ORDER BY a.id "; // change to .team
$result = mysql_query($sql) or die ("Error when building the team league table! (function 2)");
if ($myrow = mysql_fetch_array($result)){
many thanks jason