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
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
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
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());
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
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
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
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
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
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
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:
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
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
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
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
-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
acters.
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 4/23/01, 3:59:41 PM, "elias" <[EMAIL PROTECTED]> wrote
regarding Re: [PHP] if... then... else with HTML:
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
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...
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
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
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
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
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 (
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
25 matches
Mail list logo