Getting Familiar With Site Checklist

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sebthib55
Forum Newbie
Posts: 4
Joined: Fri Jun 20, 2008 1:44 pm

Getting Familiar With Site Checklist

Post by sebthib55 »

Hello,
I want to create script for my site that makes a user go through a checklist of things.
This checklist would have its own page and would list everything they must do and what they havn't yet done.
The user must do the entire list. If he/she doesn't, there is a banner that would display on all the pages until the new member would complete it. Once completed, the banner would disappear. This is so they get familiar with most features of the site.

Anyways, my question is, how can I organise my tables in my sql database? I don't want multiple entries per user, but I also want the script to run and check what they have and what they havn't done all together but no use too many queries.

I did think of making it complete a row for every task a user does, but when you go to check what tasks have been done, it may have to check through many entries, and make multiple searches.

Any ideas?

Thanks!
Seb
sebthib55
Forum Newbie
Posts: 4
Joined: Fri Jun 20, 2008 1:44 pm

Re: Getting Familiar With Site Checklist

Post by sebthib55 »

Here is my script (template) It doesn't seem to work. What can I do to fix it?

Code: Select all

$taskcheck=@mysql_fetch_array(mysql_query("SELECT taskid FROM newbie_checklist WHERE user='$exist[1]'"));
 
echo"<p><table width='50%' cellpadding='3' cellspacing='1' class='tableborder'>
<tr>
<td class='arcade1' colspan='6'><center><b>Task</b></td><td class='arcade1' colspan='6'><center><b>Completed</b></td>
</tr>";
echo"<tr><td class='arcade1' colspan='6'>
<center><b>Play 10 Games</b></td><td class='arcade1' colspan='6'><center>"; if($taskcheck[taskid]=="1"){echo"YES";}else{echo"NO";}echo"</td></tr>";
echo"<tr><td class='arcade1' colspan='6'>
<center><b>Post 10 Times</b></td><td class='arcade1' colspan='6'><center>"; if($taskcheck[taskid]=="2"){echo"YES";}else{echo"NO";}echo"</td></tr>";
echo"<tr><td class='arcade1' colspan='6'>
<center><b>Get 3 trophies</b></td><td class='arcade1' colspan='6'><center>"; if($taskcheck[taskid]=="3"){echo"YES";}else{echo"NO";}echo"</td></tr>";
 
echo"</table>";
Only the first task shows that it has been completed while I made the database take note of me completing 1 and 2.
Post Reply