Current location: Hot Scripts Forums » Programming Languages » PHP » }else{ error in script, can't find it


}else{ error in script, can't find it

Reply
  #1 (permalink)  
Old 02-23-05, 01:21 PM
ObliviatorKK ObliviatorKK is offline
Newbie Coder
 
Join Date: Nov 2004
Location: New Britain, Connecticut
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Question }else{ error in script, can't find it

My code:

PHP Code:

function rankup() {


$sqlxx mysql_query("select * from user where username = '$_SESSION[username]'");
$resultSetxx mysql_fetch_array($sqlxx);
$userid $resultSetxx['id'];
$usercrew $resultSetxx['crew'];

$sqlxx mysql_query("SELECT * FROM crew WHERE id='$usercrew'");
$crew_infoxx mysql_fetch_array($sqlxx);
$usercrewleader $crew_infoxx['leader'];

if (
$userid == $usercrewleader) {

$user_id $_GET['id'];

$sql mysql_query("select * from user where id = '$user_id'");
$r mysql_fetch_array($sql);
$rank $r['rank'];
if (
$rank 1) {
echo 
"This user is already Rank 1.";
} else {
$sqlfrom mysql_query("select * from user where id = '$user_id'");
$rfrom mysql_fetch_array($sqlfrom);
$rupdate $rank 1;
$q1 mysql_query("UPDATE user SET rank = '$rupdate' WHERE id='$user_id'");
echo 
"Users Rank was Upgraded.";
}
} else {
echo 
"You're not allowed to do this, only your leader can do this.";
}

I can't seem to find the error, I am currently set to leader, and even when the user I want to upgrade is set to 5, it still says "This user is already rank 1" I figure its an error in my way that I did the }else{, it might be a little messy.
Reply With Quote
  #2 (permalink)  
Old 02-23-05, 01:30 PM
jasong jasong is offline
Wannabe Coder
 
Join Date: Feb 2004
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
PHP Code:

// You have:

if ($rank 1) {

// Should be:
if ($rank == 1) { 
__________________
SnapSlides.Com - Create slideshows online to share with friends and family.
Reply With Quote
  #3 (permalink)  
Old 02-23-05, 01:33 PM
ObliviatorKK ObliviatorKK is offline
Newbie Coder
 
Join Date: Nov 2004
Location: New Britain, Connecticut
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
...

I can't believe I missed that, but I'm real tired, didn't get much sleep last night. Thank you VERY much. :-)
Reply With Quote
  #4 (permalink)  
Old 02-23-05, 01:38 PM
jasong jasong is offline
Wannabe Coder
 
Join Date: Feb 2004
Posts: 160
Thanks: 0
Thanked 0 Times in 0 Posts
No problem
__________________
SnapSlides.Com - Create slideshows online to share with friends and family.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 10:17 AM
how can I find a paging script? mariocg PHP 1 01-06-05 03:17 PM
Is there any integrity of script rankings? webmaster@atmanager.com Hot Scripts Forum Questions, Suggestions and Feedback 17 08-06-04 12:12 AM
Please help find script... fusion Script Requests 0 05-26-04 12:02 AM
is it possible to find out what script this is? vashawtee PHP 0 09-02-03 07:20 PM


All times are GMT -5. The time now is 05:33 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.