(PHP) Error in PHP code.

Kristopher

Photographer
Dec 25, 2010
803
68
<img src="./images/badgeback.png">
<img src="./images/badgeback.png">
<img src="./images/badgeback.png">
<img src="./images/badgeback.png">
<img src="./images/badgeback.png">
</div>
<?php

$getBadges = dbquery("SELECT * FROM user_badges WHERE user_id = '" . USER_ID . "' AND badge_slot >= 1 ORDER BY badge_slot DESC LIMIT 5");

?>

<div id="badge-back">
<ul class="badge-back"><br>
<?php
while($b = mysql_fetch_assoc($getBadges)){
echo '&nbsp;&nbsp;<img src=" ' . $b['badge_id'] . '.gif"> &nbsp; &nbsp;';
}
?>

For some reason this code isn't working and everything seems to be right for me and there is no errors....
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
White page?
<img src="/images/badgeback.png">
<img src="/images/badgeback.png">
<img src="/images/badgeback.png">
<img src="/images/badgeback.png">
<img src="/images/badgeback.png">
</div>
<div id="badge-back">
<ul class="badge-back"><br>
<?php
$getBadges = mysql_query("SELECT * FROM `user_badges` WHERE `user_id` = '" . USER_ID . "' AND `badge_slot` >= '1' ORDER BY `badge_slot` DESC LIMIT 5");
while($b = mysql_fetch_assoc($getBadges)){
echo '&nbsp;&nbsp;<img src=" ' . $b['badge_id'] . '.gif"> &nbsp; &nbsp;';
}
?>
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
<?php
$getBadges = mysql_query("SELECT * FROM `user_badges` WHERE `user_id` = '" . USER_ID . "' AND `badge_slot` >= '1' ORDER BY `badge_slot` DESC LIMIT 5");
while($b = mysql_fetch_assoc($getBadges)){
echo '&nbsp;&nbsp;<img src=" ' . $b['badge_id'] . '.gif"> &nbsp; &nbsp;';
}
?>
white screen has to do with PHP so its going to be your syntax somewhere in here^
I think its your syntax for this
echo '&nbsp;&nbsp;<img src=" ' . $b['badge_id'] . '.gif"> &nbsp; &nbsp;';
 

Blure

New Member
Jun 1, 2014
2
0
I wouldn't recommend using mysql, because it's deprecated, instead you should use mysqli, PDO.

Try to turn on error_reporting.

Sent from my HTC One using Tapatalk
 

Users who are viewing this thread

Top