...

View Full Version : Need help with a achievement script



Greenbox
03-16-2010, 04:29 PM
Ok, my problem is when the user gets 10+ "credits" the image change to completed. But when he uses all his "credits" then the completed turns into incomlplete again, how can i make it stay completed when the achievement is completed?


<?php
session_start();
include_once "includes/db_connect.php";
include_once "includes/functions.php";
logincheck();
$username=$_SESSION['username'];
$query=mysql_query("SELECT * FROM users WHERE username='$username'");
$fetch=mysql_fetch_object($query);
$query1=mysql_query("SELECT * FROM user_info WHERE username='$username'");
$fetch1=mysql_fetch_object($query1);


?>
<html>
<head>
<title>Achievement</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="includes/in.css" rel="stylesheet" type="text/css">
</head>

<body>

<td>&nbsp;</td>
<td><span><b>Currently Holding Over 10 Credits</b></span></td>
<td><span><b>Currently holding 10 or more </b></span></td>
<td>
<span>
<? if ($fetch->credits >= "10"){ ?>
<img src="images/complete.png"><? }else{ ?><img src="images/incomplete.png"><? } ?>
</span></td>
</tr>
</body>
</html>


Suggestions? :)

Fumigator
03-16-2010, 05:10 PM
Looks like you need to tweak your database design. Do you have a table that stores achievements?

masterofollies
03-16-2010, 05:18 PM
What is $fetch1 and $query1 used for?

It's a good idea to use <?php instead of <? because sometimes it confuses the language and messes up. It's always better to use <?php

Greenbox
03-16-2010, 05:38 PM
user_info is the one where i get all the achievement data, but im kinda noob at php so please go more in details :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum