Small problem with a IF statement

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

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

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";
$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.

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

Tue Dec 31, 2002 11:13 am

I always use one of the following to refer to my form variables:

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

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Thu Jan 02, 2003 12:11 am

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

Post Reply