Jump to content

Code prints nothing! :(


ondi

Recommended Posts

I have been through this code, and there doesn't seem to be any errors, but it still does not print anything. There is data which it should be printed in my database. Could anyone have a look? Cheers

 

session_start();

include('admin/user.php');
$connection = mysql_connect("$host","$user","$password")
or die(mysql_error());
mysql_select_db("$txt_db_name",$connection)
or die(mysql_error());

//
//Includes preferences
//
$pref = mysql_query("SELECT * FROM tplls_preferences WHERE ID = '1'",$connection)
or die(mysql_error());
$pdata = mysql_fetch_array($pref);
mysql_free_result($pref);

$team_name = $pdata['teamname'];
$d_seasonid = $pdata['defaultseasonid'];
$show_all_or_one = $pdata['defaultshow'];
$show_table = $pdata['defaulttable'];
$language = $pdata['defaultlanguage'];
$for_win = $pdata['forwin'];
$for_draw = $pdata['fordraw'];
$for_lose = $pdata['forloss'];
$print_date = $pdata['printdate'];
$top_bg = $pdata['topoftable'];
$bg1 = $pdata['bg1'];
$bg2 = $pdata['bg2'];
$inside_c = $pdata['inside'];
$border_c = $pdata['bordercolour'];
$tb_width = $pdata['tablewidth'];
$accept_ml = $pdata['acceptmultilanguage'];


?>

<?php

$get_matches = mysql_query("
SELECT O.OpponentName AS hometeam,
OP.OpponentName AS awayteam,
LM.LeagueMatchHomeGoals AS goals_home,
LM.LeagueMatchAwayGoals AS goals_away,
LM.LeagueMatchID AS id,
DATE_FORMAT(LM.LeagueMatchDate, '$print_date') AS date
FROM tplls_leaguematches LM, tplls_opponents O, tplls_opponents OP
WHERE O.OpponentID = LM.LeagueMatchHomeID AND
OP.OpponentID = LM.LeagueMatchAwayID AND
LeagueMatchSeasonID LIKE '$defaultseasonid' AND LM.LeagueMatchHomeGoals IS NOT NULL
ORDER BY LM.LeagueMatchDate DESC",$connection)
or die(mysql_error());

$i=0;
while($data = mysql_fetch_array($get_matches))
{
if($i==0)
{
$temp = $data['date'];
}

if($temp == $data['date'])
{
//print match
}
else
{
break;
}

$i++;
}

?>

Link to comment
Share on other sites

Humm, i changed it so the print part is now

 

$i=0;
while($data = mysql_fetch_array($get_matches))
{
   if($i == 0)
   {
      $temp = $data['date'];
   }

   if($data['date'] == $temp)
   {
      //print match
      echo"$data[hometeam] - $data[awayteam] $data[goals_home]-$data[goals_away]<br>";
   }
   else
   {
      break;
   }

   $i++;
}

 

but still nothing is printed :(

Link to comment
Share on other sites

$i=0;
while($data = mysql_fetch_array($get_matches))
{
   if($i == 0)
   {
      $temp = $data['date'];
   }

   if($data['date'] == $temp)
   {
      //print match
      echo"$data[hometeam] - $data[awayteam] $data[goals_home]-$data[goals_away]<br>";
   }
   else
   {
      break;
   }

   $i++;
}

 

but still nothing is printed :(

 

 

This is just an idea on what you need to do. I do not know what you were doing.

    echo $data['hometeam'] ." - ". $data['awayteam'] . " " . $data['goals_home'] ." - " . $data['goals_away'] . "<br>";

Link to comment
Share on other sites

Taking a look at the HTML source in the page you've posted, it looks malformed since your closing 3 tables that you never open. Looks like there might be a problem earlier up in the page that's causing this.

 

Your Generate HTML:

	</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.