Hey need some help please :)

This is a discussion on "Hey need some help please :)" within the PHP Forum section. This forum, and the thread "Hey need some help please :) are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 25th, 2008, 00:23
Up'n'Coming Member
Join Date: Sep 2006
Location: Nottingham
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ducky Send a message via MSN to Ducky Send a message via Yahoo to Ducky Send a message via Skype™ to Ducky
Hey need some help please :)

Ok well I'm helping a mate with a site www.allhopedeleted.com/site/ ok and I want to add in the member list a VIP title the way the other titles work is by the perm field in the database and the super field like so

PHP: Select all

if ($row['perm'] == AND $row['super'] == no) {
echo 
"<b>Admin</b>";

And this works fine. So I didn't want to add any special permissions for VIP's just the title so I assumed adding a field called rank and using the code

PHP: Select all

elseif ($row['rank'] == vip AND $row['super'] == no) {
echo 
"<customrank>VIP</customrank>";

yet it doesn't hmm?

and yes the said user I'm testing on was given the value vip.

Thanks in advance for help
Reply With Quote

  #2 (permalink)  
Old Mar 25th, 2008, 04:49
Reputable Member
Join Date: Nov 2007
Location: India
Posts: 150
Blog Entries: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Hey need some help please :)

Did you change the value in your database?

btw would you please rephrase your entire post?
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
Reply With Quote
  #3 (permalink)  
Old Mar 25th, 2008, 08:22
New Member
Join Date: Jan 2007
Location: Manchester
Age: 27
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Hey need some help please :)

PHP: Select all

elseif ($row['rank'] == vip AND $row['super'] == no) {
echo 
"<customrank>VIP</customrank>";

I would imagine from this bit if you change it to:
PHP: Select all

elseif ($row['rank'] == 'vip' AND $row['super'] == no) {
echo 
"<customrank>VIP</customrank>";




You might find that solves the issue. In Php the variable if a text string needs putting within quotes where as numbers do not.

If that doesn't solve it then it may also be something to do with the code before the elseif.
Reply With Quote
  #4 (permalink)  
Old Mar 25th, 2008, 13:00
Up'n'Coming Member
Join Date: Sep 2006
Location: Nottingham
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ducky Send a message via MSN to Ducky Send a message via Yahoo to Ducky Send a message via Skype™ to Ducky
Re: Hey need some help please :)

I'm afraid quotes doesn't work. And the code before it works.

This is all the code for ranks.

PHP: Select all

if ($row['perm'] == AND $row['super'] == no) {

echo 
"<b>Admin</b>";
}

elseif (
$row['perm'] == AND $row['super'] == no) {
echo 
"<user>User</user>";
}

elseif (
$row['rank'] == vip AND $row['super'] == no) {
echo 
"<customrank>VIP</customrank>";
}

elseif (
$row['perm'] == AND $row['super'] == no) {
echo 
"<mod>Moderator</mod>";
}

else {
echo 
"<em>Super Admin</em>";

Reply With Quote
  #5 (permalink)  
Old Mar 25th, 2008, 13:17
New Member
Join Date: Jan 2007
Location: Manchester
Age: 27
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Hey need some help please :)

Ok well I am taking it you are copying the previous.

I don't understand the user sending the vip bit?

The previous code looks like it is checking against a database. Therefore the database obviously has a perm row which it is grabbing.

So by adding the row rank you are setting people can be called vip or some other yes?

So given your code you would have to check some things:

Firstly you have a "rank" row in the db results to check against and this is set to vip (this is why i don't understand the passing by the user bit because then it would be a POST var no?)

Secondly the rank for the user being checked does in fact = vip and they they are not set as a super user i.e. $row['super'] == no

Thirdly if those things are there then check the code doing the search on the database. If this is a thirdparty script then highly likely that the whole row set isn't being returned and therefore the rank variable isn't present?

These are all just guesses really but you need to be logical about going through why its not working. Without seeing the whole code for the query and that the database is correct then its difficult to narrow it down further based on what is provided.
Reply With Quote
  #6 (permalink)  
Old Mar 25th, 2008, 21:17
Up'n'Coming Member
Join Date: Sep 2006
Location: Nottingham
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Ducky Send a message via MSN to Ducky Send a message via Yahoo to Ducky Send a message via Skype™ to Ducky
Re: Hey need some help please :)

I've correctly sorted all those points and the issue is still occuring :/
Reply With Quote
  #7 (permalink)  
Old Mar 30th, 2008, 16:16
Junior Member
Join Date: Oct 2007
Location: UK
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Hey need some help please :)

Have you tried
Code: Select all
<pre><?php print_r($row);?></pre>
to check that
Code: Select all
$row['rank'] == 'vip' AND $row['super'] == 'no'
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 20:52.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43