Small problem with a IF statement

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Erick020
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Dec 26, 2002 6:20 am

Small problem with a IF statement

Postby Erick020 » Mon Dec 30, 2002 3:51 am

What I did is first:
$q = "select User_Country from table where
User_ID = $User_ID";
if ($r=mysql_fetch_object($res)){
echo "<input type=Hidden name=Country value= $r->User_Country>";
}
\\ I also tryed with mysql_fetch_array

So far so good !
Now the if thing:

if ($User_Country == "$Country "){
$VAT_Amount = "19 * $All_Total_Order/ 100";
}else{
$VAT_Amount = "xxxxx.xx";
}
echo "$VAT_Amount ";

I know I mis something somewhere but I can't find out what exactly..
I don't get any ERROR, but it seems it doesn't recognize $Country (I print it right in the Hidden field).

If somebody out there can help me, I'll appreciate.
Thanks,
Erick.

User avatar
Skeletor
New php-forum User
New php-forum User
Posts: 147
Joined: Tue Nov 19, 2002 7:47 am
Location: US, Ohio
Contact:

reply

Postby Skeletor » Tue Dec 31, 2002 11:13 am

I always use one of the following to refer to my form variables:
$_POST['Country']
$_GET['Country']
$_REQUEST['Country']

don't know if you have to, or if it would help you in this case.

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Thu Jan 02, 2003 12:11 am

if ($r=mysql_fetch_array($res)){
echo "<input type=Hidden name=Country value='$r[User_Country]">";
}


Return to “PHP coding => General”

Who is online

Users browsing this forum: Google [Bot], Google Feedfetcher and 3 guests

cron