dark dude Posted June 28, 2006 Share Posted June 28, 2006 What's the problem with my script? I get a white page opening it, indicating a problem with the script, but I cant find the problems...[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?session_start();$Username = $_SESSION['Username'];include("dbinfo.inc.php");mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");$query = "SELECT * FROM Users WHERE Username='$Username'";$result = mysql_query($query) or die(mysql_error());$results = mysql_fetch_array($result);$query = "SELECT * FROM Alliances WHERE AllianceName='$results[Alliance]'";$result2 = mysql_query($query) or die(mysql_error());$results2 = mysql_fetch_array($result2);$query = "SELECT * FROM Diplomacy WHERE AllianceName='$results[Alliance]'";$result3 = mysql_query($query) or die(mysql_error());$results3 = mysql_fetch_array($result3);if($results[Alliance]==""){?><table><tr><th>Alliance Search</th></tr><tr><td><form name="search" method="post" action="alliancesearch.php">Search Alliance Tag <input name="Search" type="text" size="20" maxlength="18"/> <input type="submit">Search</input></form></td></tr></table><?} else {?><table><tr><th>Alliance "<? echo $results2[AllianceName] ?>"'s Panel</th></tr><tr><td><center>Alliance Name: <? echo $results2[AllianceName] ?></td></tr><tr><td>Alliance Tag: <? echo $results2[AllianceTag] ?></td></tr><tr><td>Members: <? echo $results2[Members] ?></td></tr><tr><td>Rank: <? echo $results[AllianceRank] ?></td></tr><tr><td><? echo $results2[Description] ?></td></tr><tr><th>Diplomacy Status</th></tr><tr><td><?if($results3[War]==""){echo '<span style=color:red><b>Wars:</b></span> The Alliance is at Peace';}else {echo '<span style=color:red><b>Wars:</b></span> 1.'.$results3[War].'<br>2.'.$results3[War2].'<br>3.'.$results3[War3].'<br>4.'.$results3[War4].'<br>5.'.$results3[War5].';}?></td></tr><tr><td><?if($results3[Ally]==""){echo '<span style=color:red><strong>Wars:</strong></span> The Alliance is Unified';}else {echo '<span style=color:red><strong>Wars:</strong></span> 1.'.$results3[Ally].'<br>2.'.$results3[Ally2].'<br>3.'.$results3[Ally3].'<br>4.'.$results3[Ally4].'<br>5.'.$results3[Ally5].';}?></td></tr></table><?}[/quote]Thanks for any help ^_^,~Dark dude~ Quote Link to comment Share on other sites More sharing options...
Buyocat Posted June 28, 2006 Share Posted June 28, 2006 In the connect statement doesn't localhost need quotes around it? At any rate try turning on error reporting in the php.ini file and let us know what line the error is reported (preferably by marking it in the code), if you can't get error reporting on then try echoing from the top of your script down, till you hit the part that doesn't work. Quote Link to comment Share on other sites More sharing options...
dark dude Posted June 28, 2006 Author Share Posted June 28, 2006 Oh, it's because I didnt escape properly, it's fixed now, but thanks for telling me about the echo bug check thing, that saved my neck =]Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.