newbie question...

hey I’m new to php and can’t quite figure out what I’m doing wrong… anyone have an idea by looking at it? it’s supposed to show how many credits the person has but it seems to just be ignoring the $credits part…

if (!empty($_SESSION[$CONFIG_name.‘account_id’])) {
if ($_SESSION[$CONFIG_name.‘account_id’] > 0) {
$userid = htmlformat($_SESSION[$CONFIG_name.‘userid’]);

	$query = sprintf(LOGIN_CREDITS, $userid);
	$result = execute_query($query, 'index.php');
	$line = $result->fetch_row();

	$credits = $line[0];

	echo "
	<script type="text/javascript">
	<tr><td align=center>
	".$lang['LOGIN_HELLO'].", $userid.<br><br>
	".$lang['LOGIN_CREDITS']." $credits ".$lang['CREDITS'].".<br><br>
	<span title="Logoff the server and, if any, reset the cookies" style="cursor:pointer" onMouseOver="'#FF3300'" onMouseOut="'#000000'" onClick="LINK_ajax('login.php?opt=2','login_div');">Logoff</span>

any and all help is greatly appreciated, thanks!

are you sure your connecting to the database properly i know when i have had this problem of the value not showing it comes down to the fact the database is not being connected to check and make sure

See the debugging thread linked to in my signature. There’s some really nifty tips and tricks there, like error_reporting(), echoing your vars and others.

alright! thanks guys, I think the debugging thing will help a lot.

Sponsor our Newsletter | Privacy Policy | Terms of Service