Brian J Kirk
Brian J Kirk

Reputation: 61

White Screen error When running script

I am trying to run a script for my website and I am getting a white screen with no errors, I have tried running the script with

error_reporting(E_ALL);
ini_set('display_errors',TRUE);

But I still get no errors, I do not have access the php.ini as I am using a godaddy.

//Get ITID from URL
$iITID = $_GET["ITID"];

$oteaminfo = mysql_query("
SELECT .Players.FirstName, Players.LastName, Players.Position, Players.Height,                    Players.Weight, .Players.DOB, Countries.Nation, NHLTeams.Team,      ;  ; ; InternationalTeam.InternationalTeam, InternationalLeagues.InternationLeague,    CNGHLTeams.CNGHLRights
From Players
Inner Join InternationalTeam
On Players.ITID=InternationalTeam.ITID
Inner Join InternationalLeagues
On Players.ILID=InternationalLeagues.ILID
Inner Join Countries
On Players.NationID=Countries.NationID
Inner Join NHLTeams
On Players.TeamsID=NHLTeams.TeamID
Inner Join CNGHLTeams
On Players.CNGHLID=CNGHLTeams.CNGHLID
WHERE InternationalTeam.InternationalTeam=$iITID
ORDER BY Players.LastName;
") or die(mysql_error()); 

while($row = mysql_fetch_array($oteaminfo)) 
{ 
Print "Player Name: ".$row['FirstName']." ".$row['LastName']."<br>"; 
Print "Position: ".$row['Position']."<br>"; 
Print "Height: ".$row['Height']."<br>"; 
Print "Weight: ".$row['Weight']."<br>"; 
Print "Birthdate: ".$row['DOB']."<br>"; 
Print "Nationality: ".$row['NationID']."<br>";
Print "NHL Rights: ".$row['Team']."<br>";
Print "CNGHL Team: ".$row['CNGHLRights']."<br>"; 
} 


  ?>

The script is missing Players.Weight, .Players.DOB, Countries.Nation, NHLTeams.Team, InternationalTeam.InternationalTeam, InternationalLeagues.InternationLeague, CNGHLTeams.CNGHLRights

As it wont let me indent it to show up as script. I have tried looking up this issue but I cannot seem to find anything that will help me in my situation. Any Help would be wonderful thanks.

Upvotes: 1

Views: 150

Answers (2)

user2672373
user2672373

Reputation:

I think it is the beginning of your SQL

SELECT .Players.FirstName, Players.LastName, Players.Position

that is messing up. The corrected SQL should be like

SELECT Players.FirstName, Players.LastName, Players.Position

And, as you are attempting to print results on a page, preferably use echo than print. And, print should be print and not Print. PHP is case sensitive.

Also, as per PHP Manual, mysql_ commands are deprecated. It is preferable to use mysqli_ commands or PDO.

Upvotes: 1

Oleg Belousov
Oleg Belousov

Reputation: 10121

Try ini_set('display_errors', 'On'); Basically since the latest release of PHP you can define error visibility per each level, but this line should do it.

Let me know if it helps, if not I might rewrite your code using PDO and try - catch blocks, this way you will be able to raise an exception, and generally your code will be more secure.

http://php.net/manual/en/book.pdo.php

Upvotes: 0

Related Questions