Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
If statement won't work
Old 11-28-2007, 08:48 PM If statement won't work
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
PHP Code:
if ($checkclosed==1|$paidfor==0) {
$winningamounts=getSqlField("SELECT winamount FROM probid_auctions WHERE id='".$_GET['id']."'","winamount");
$newb$winningamounts $upbalance;
mysql_query("UPDATE probid_users SET accountbalance='$newb' WHERE id='$winauctions'");
mysql_query("UPDATE probid_auctions SET paidfor='1' WHERE id='".$_GET['id']."'");
} else {

Even though the user is paid which would set $paidfor=1 which it does the script just skips the condition that $paidfor=0 even though the script was executed already and the value was changed to 1. Am I using the If statement wrong or something?
MoForce is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-28-2007, 08:49 PM Re: If statement won't work
Arenlor's Avatar
Ultra Talker

Posts: 462
Name: Jerod Lycett
Location: /home/arenlor
Trades: 0
|| not |
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-28-2007, 08:51 PM Re: If statement won't work
MoForce's Avatar
Super Talker

Posts: 145
Name: Jack Shalt
Trades: 0
I got it to work... nvm.. thanks anyway and I'll try using || instead of | to see if that works too

PHP Code:
if ($checkclosed==1) {
    if (
$paidfor==0){
$winningamounts=getSqlField("SELECT winamount FROM probid_auctions WHERE id='".$_GET['id']."'","winamount");
$newb$winningamounts $upbalance;
mysql_query("UPDATE probid_users SET accountbalance='$newb' WHERE id='$winauctions'");
mysql_query("UPDATE probid_auctions SET paidfor='1' WHERE id='".$_GET['id']."'");
                    }
                        } else { 
that's what I was supposed to do
MoForce is offline
Reply With Quote
View Public Profile
 
Old 11-28-2007, 08:58 PM Re: If statement won't work
Ultra Talker

Posts: 483
Trades: 0
If you 'solved' it via an if inside another if, you want '&&' not '||'.
__________________

Please login or register to view this content. Registration is FREE
TwistMyArm is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to If statement won't work
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25902 seconds with 12 queries