Re: [PHP] if then else statement not working

2005-05-09 Thread Deep
Hi, Where are the dollar signs before seatnum, seat1 etc in the if condition. ..Deeps.. --- Anasta <[EMAIL PROTECTED]> wrote: > What am i doing wrong here, the output is always > 'empty' > > > > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_erro

Re: [PHP] if then else

2005-05-06 Thread Richard Lynch
On Wed, May 4, 2005 12:20 am, Anasta said: > Can anyone help with a statement, ive tried but it never works. > I need to show a value if it is set to a specific value ie: > > At the moment If a user is logs in a record is updated from 'away' to > 'online'---so i want an echo statement to show a va

Re: [PHP] if then else statement not working

2005-05-05 Thread Rasmus Lerdorf
Anasta wrote: > What am i doing wrong here, the output is always 'empty' > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_error()); > > if (seatnum == seat1) { > echo username; > } else { > echo 'empty'; > } > ?> That doesn't even look like PHP cod

Re: [PHP] if then else statement not working

2005-05-05 Thread Philip Hallstrom
What am i doing wrong here, the output is always 'empty' if (seatnum == seat1) { echo username; } else { echo 'empty'; } ?> Just guessing since I'm not sure what you're trying to do, but... $result = mysql_query("SELECT username FROM users WHERE seatnum='seat1'") or die(mysql_error());

Re: [PHP] if then else statement not working

2005-05-05 Thread Gabriel Guzman
Anasta wrote: What am i doing wrong here, the output is always 'empty' if (seatnum == seat1) { echo username; } else { echo 'empty'; } ?> mysql_query() returns a resource, not the results themselves. read: http://us3.php.net/manual/en/function.mysql-query.php especially the 2nd example to see

Re: [PHP] if then else statement not working

2005-05-05 Thread bala chandar
On 5/5/05, Anasta <[EMAIL PROTECTED]> wrote: > What am i doing wrong here, the output is always 'empty' > > $result = mysql_query("SELECT username FROM users > WHERE seatnum='seat1'") or die(mysql_error()); > > if (seatnum == seat1) { you must use if (seatnum == "seat1") { > echo userna

[PHP] if then else statement not working

2005-05-05 Thread Anasta
What am i doing wrong here, the output is always 'empty' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] if then else

2005-05-04 Thread Anasta
Can anyone help with a statement, ive tried but it never works. I need to show a value if it is set to a specific value ie: At the moment If a user is logs in a record is updated from 'away' to 'online'---so i want an echo statement to show a value from another table if they are set to online or

Re: [PHP] if then else short form

2005-01-21 Thread Manoj
language tutorial (basic)... >if ( a=b ) ? a=1 ; a=2; a = a==b ? 1 : 2 ; Cheer, Manoj Kr. Sheoran Software Engg. Daffodil Software Ltd. web: www.daffodildb.com INDIA On Fri, 2005-01-21 at 17:31, Ben Edwards wrote: > I seem to remember seing someone use a abreaviated form of a > if/th

Re: [PHP] if then else short form

2005-01-21 Thread Jochem Maas
Ben Edwards wrote: I seem to remember seing someone use a abreaviated form of a if/them/else of the type that can be used in java. It was something like if ( a=b ) ? a=1 ; a=2; I called it the 'tertiary' syntax which is not correct: to quote a page I found: " that the book refers to a "tertiary" op

Re: [PHP] if then else short form

2005-01-21 Thread Jochem Maas
Ben Edwards wrote: I seem to remember seing someone use a abreaviated form of a if/them/else of the type that can be used in java. It was something like if ( a=b ) ? a=1 ; a=2; $a = ($a == $b) ? 1: 2; which meand: if $a is equal to $b then set $a to 1 otherwise set $a to 2. that is equivalent to:

Re: [PHP] if then else short form

2005-01-21 Thread Sergio Gorelyshev
On Fri, 21 Jan 2005 12:01:09 + Ben Edwards <[EMAIL PROTECTED]> wrote: > I seem to remember seing someone use a abreaviated form of a > if/them/else of the type that can be used in java. > > It was something like > > if ( a=b ) ? a=1 ; a=2; > > Anybody know what the correct syntax is? condi

Re: [PHP] if then else short form

2005-01-21 Thread Richard Davey
Hello Ben, Friday, January 21, 2005, 12:01:09 PM, you wrote: BE> I seem to remember seing someone use a abreaviated form of a BE> if/them/else of the type that can be used in java. BE> It was something like BE> if ( a=b ) ? a=1 ; a=2; BE> Anybody know what the correct syntax is? It's called a

[PHP] if then else short form

2005-01-21 Thread Ben Edwards
I seem to remember seing someone use a abreaviated form of a if/them/else of the type that can be used in java. It was something like if ( a=b ) ? a=1 ; a=2; Anybody know what the correct syntax is? Ben -- Ben Edwards - Poole, UK, England WARNING:This email contained partisan views - dont ever

RE: [PHP] if then else?

2001-08-18 Thread Glyndower
btw...this is the code i'm trying Please keep the laughter to a minimum...ah heck with it...laugh all you want...its good for ya Professional Experience: This field is empty output for users with a variable other than value1 or value2 This field is empty output for users wit

[PHP] if then else?

2001-08-18 Thread Glyndower
-Original Message- From: Glyndower [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 19, 2001 12:12 AM Cc: [EMAIL PROTECTED] Subject: Ok, here we go I'm new to PHP and also to MySql, but i'm making a pretty good go so far. Until now, lol I have a mysql database with several optiona

Re: [PHP] if... then... else with HTML

2001-04-23 Thread Richard Crawford
acters. >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 4/23/01, 3:59:41 PM, "elias" <[EMAIL PROTECTED]> wrote regarding Re: [PHP] if... then... else with HTML:

Re: [PHP] if... then... else with HTML

2001-04-23 Thread elias
yes, consider this: your name is name is not set! -elias http://eassoft.cjb.net "Martin Thoma" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello ! > > I want to do something like > > if (condition) > output this html-block > else > output

SV: [PHP] if... then... else with HTML

2001-04-23 Thread Fredrik Wahlberg
I hope I understood your question right. You can do like this html text other html > -Ursprungligt meddelande- > Fran: Martin Thoma [mailto:[EMAIL PROTECTED]] > Skickat: den 23 april 2001 14:41 > Till: [EMAIL PROTECTED] > Amne: [PHP] if... then...

Re: [PHP] if... then... else with HTML

2001-04-23 Thread Avetis Avagyan
Something like this: output this html-block output that html-block Regards, Avetis Martin Thoma wrote: > Hello ! > > I want to do something like > > if (condition) > output this html-block > else > output that html-block > > Without printig or echoing the html-block out (beca

RE: [PHP] if... then... else with HTML

2001-04-23 Thread Tyler Longren
1st HTML here 2nd HTML here > -Original Message- > From: Martin Thoma [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 7:41 AM > To: [EMAIL PROTECTED] > Subject: [PHP] if... then... else with HTML > > > Hello ! > > I want to do som

Re: [PHP] if... then... else with HTML

2001-04-23 Thread Geir Eivind Mork
On Monday 23 April 2001 14:41, Martin Thoma wrote: if ($word != "flat") { echo << html html -- php developer / CoreTrek AS| I judge a religion as being good or bad Sandnes / Rogaland / Norway| based on whether its adherents become web: http://www.moijk.net/ | bette

RE: [PHP] if... then... else with HTML

2001-04-23 Thread Taylor, Stewart
HTML HTML -Stewart -Original Message- From: Martin Thoma [mailto:[EMAIL PROTECTED]] Sent: 23 April 2001 13:41 To: [EMAIL PROTECTED] Subject: [PHP] if... then... else with HTML Hello ! I want to do something like if (condition) output this html-block else output that

Re: [PHP] if... then... else with HTML

2001-04-23 Thread Martin Thoma
Ah, I forgott the {} ;-) You are using Internet Explorer You are not using Internet Explorer Martin Thoma schrieb: > Hello ! > > I want to do something like > > if (condition) > output this html-block > else > output that html-block > > Without printig or echoing the html-block out (

[PHP] if... then... else with HTML

2001-04-23 Thread Martin Thoma
Hello ! I want to do something like if (condition) output this html-block else output that html-block Without printig or echoing the html-block out (because the block has a lot of ", which I all would have to slash out...) How can I do that ? Martin -- PHP General Mailing List