Well actually, all 80 fields (not records) that I'm displaying out of the
row (matched by phone number) have to be displayed on the page.
Non-Editable. Just displayed for viewing.
I am certainly using the query to search dbase and display the results. So
technically nothing that I'm doing is caus
On Friday 06 October 2006 21:59, Rahul S. Johari wrote:
> I'm not sure if I understand your point then! I have about 80 fields in
> that database that are fetched and displayed on the page using this code.
> If there's a simpler way to do this, and have it work the if() else() error
> as well, I wo
On Fri, October 6, 2006 2:59 pm, Rahul S. Johari wrote:
> I'm not sure if I understand your point then! I have about 80 fields
> in that
> database that are fetched and displayed on the page using this code.
> If
> there's a simpler way to do this, and have it work the if() else()
> error as
> well
On Fri, October 6, 2006 2:45 pm, Rahul S. Johari wrote:
> Well, the actual script doesn't just print "found number" if the
> number
> exists... It displays all the data from the database of that record,
> also
> gives an interactive form to update the data and more.
None of which is a Good Reason
On Fri, October 6, 2006 11:35 am, Rahul S. Johari wrote:
> $db = dbase_open("osm.dbf", 0);
> if ($db) {
> $record_numbers = dbase_numrecords($db);
$found = false;
> for ($i = 1; $i <= $record_numbers; $i++) {
> $row = dbase_get_record_with_names($db, $i);
> if ($row['PHONE'] == $theke
I'm not sure if I understand your point then! I have about 80 fields in that
database that are fetched and displayed on the page using this code. If
there's a simpler way to do this, and have it work the if() else() error as
well, I would love to know about it...
On 10/6/06 3:47 PM, "Børge Holen
On Friday 06 October 2006 21:45, Rahul S. Johari wrote:
> Well, the actual script doesn't just print "found number" if the number
> exists... It displays all the data from the database of that record, also
> gives an interactive form to update the data and more.
Yes, and my point is still valid. n
Well, the actual script doesn't just print "found number" if the number
exists... It displays all the data from the database of that record, also
gives an interactive form to update the data and more.
On 10/6/06 3:25 PM, "Børge Holen" <[EMAIL PROTECTED]> wrote:
> Why not check if $thekey is in
Why not check if $thekey is in the $db, then else echo not found?
seems all to much to do so little.
On Friday 06 October 2006 18:35, Rahul S. Johari wrote:
> Ave,
>
> code:
>
> $db = dbase_open("osm.dbf", 0);
> if ($db) {
> $record_numbers = dbase_numrecords($db);
> for ($i = 1; $i <= $record
Works like a charm!! I was trying something out with having a variable go
completely out of the functions & loops and print the "not found" message,
but I wasn't hitting it. You did!
// ^^^--- now tested ;)
On 10/6/06 1:52 PM, "Jochem Maas" <[EMAIL PROTECTED]> wrote:
> $msg = 'cannot open data
Just tried, isn't working! It's doing the same thing that exit; does.
Both
else {
echo "Not Found";
break;
}
And
else {
echo "Not Found";
exit;
}
Do the exact same thing. It will print "not found" (because it checks the
first row, and if t
Rahul S. Johari wrote:
> Ave,
>
> code:
>
> $db = dbase_open("osm.dbf", 0);
> if ($db) {
> $record_numbers = dbase_numrecords($db);
> for ($i = 1; $i <= $record_numbers; $i++) {
> $row = dbase_get_record_with_names($db, $i);
> if ($row['PHONE'] == $thekey) {
> echo ³found²;
Usen this:
echo ³not found²;
break;
""Rahul S. Johari"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
Ave,
code:
$db = dbase_open("osm.dbf", 0);
if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i <= $record_numbers; $i++) {
$row = dbase_ge
Ave,
code:
$db = dbase_open("osm.dbf", 0);
if ($db) {
$record_numbers = dbase_numrecords($db);
for ($i = 1; $i <= $record_numbers; $i++) {
$row = dbase_get_record_with_names($db, $i);
if ($row['PHONE'] == $thekey) {
echo ³found²;
}
else {
echo ³not found²;
}
On 13 August 2004 12:52, Jay Blanchard wrote:
> if( strlen( $UserID ) != 0
> && strlen( $UserPassword ) != 0
> && strlen( $SecretPassword ) != 0
> && strlen( $UserMail ) != 0 )
> {
> Do something
> }
> elseif ( strlen( $UserID ) == 0
> > > strlen( $UserPassword ) == 0
> > > strlen( $SecretPassword
[snip]
Can someone help with this please...?
if( strlen( $UserID ) != 0
& strlen( $UserPassword ) != 0
& strlen( $SecretPassword ) != 0
& strlen( $UserMail ) != 0 )
{
Do something
}
elseif ( strlen( $UserID ) == 0
or strlen( $UserPassword ) == 0
or strlen( $SecretPassword ) == 0
or strlen( $UserMa
On Friday 13 August 2004 19:33, Harlequin wrote:
> Can someone help with this please...?
>
> if( strlen( $UserID ) != 0
> & strlen( $UserPassword ) != 0
> & strlen( $SecretPassword ) != 0
> & strlen( $UserMail ) != 0 )
> {
> Do something
> }
> elseif ( strlen( $UserID ) == 0
> or strlen( $UserPassw
Can someone help with this please...?
if( strlen( $UserID ) != 0
& strlen( $UserPassword ) != 0
& strlen( $SecretPassword ) != 0
& strlen( $UserMail ) != 0 )
{
Do something
}
elseif ( strlen( $UserID ) == 0
or strlen( $UserPassword ) == 0
or strlen( $SecretPassword ) == 0
or strlen( $UserMail ) ==
Hi all,
May I just ask how do I do a "if..elseif..else" condition to check if a
"checkbox" have been checked. For some reference, I have attached my HTML code
and PHP code below:
HTML:
Payment Mode
@import url(receipt.css);
Payment Mode:
Cash
From: "Dan Anderson" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Wednesday, September 03, 2003 10:25 AM
Subject: [PHP] if else while statement speed
> I have a function where I have:
>
> while (something())
> {
&
[snip]
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a function where I have:
would it be quicker to do the above code or:
if ($option1)
{
while(something())
{ do_1(); }
}
elseif ($option2)
{
while (something())
{ do_2(); }
}
// ... continue for 10 or more options...
Thanks,
Dan
--
PHP General Mailing List (http://www.php.net
At 22:09 26.06.2003, Scott Fletcher said:
[snip]
>I am seeing the problem now. It seem that it had to do with the 'OR'
>statement inside the elseif statement... I'm going to try a workaround to
>it... As for you mentioning about the code... It's too bad t
Just found the problem, the if, else-if, else statement work okay when it is
too many. The reason it doesn't work is because there's a loophole in the
script due to someone's flaw logic or haven't thought about it when
brainstorming...
Thanks,
Scott
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in
I am seeing the problem now. It seem that it had to do with the 'OR'
statement inside the elseif statement... I'm going to try a workaround to
it... As for you mentioning about the code... It's too bad this message
window doesn't properly display the tabs
--clip--
if ($firstname == \"\") {
[snip]
Noticed something interesting. I was helping to debug someone's
programming problem and found that if there is to many 'else if' in the
if
and else statement then it doesn't work. Have anyone encoutered this
problem and know of a workaround to it?
[/snip]
I'd have to see the code
Jay
--
Hi,
>Noticed something interesting. I was helping to debug someone's
> programming problem and found that if there is to many 'else if' in the if
> and else statement then it doesn't work. Have anyone encoutered this
> problem and know of a workaround to it?
That sounds kinda bizzar
Hi!
Noticed something interesting. I was helping to debug someone's
programming problem and found that if there is to many 'else if' in the if
and else statement then it doesn't work. Have anyone encoutered this
problem and know of a workaround to it?
Thanks,
Scott
--
PHP General Mailin
I would help if you told us which line the error was on
On Sat, 5 Apr 2003 [EMAIL PROTECTED] wrote:
> Hi,
>
> I'm trying to do the following.. When $stadpict is filled in it must display the
> picture (only the path to the picture is stored in Mysql). But when the string
> ($stadpict) is empty
> I'm trying to do the following.. When $stadpict is filled in it must
> display the picture (only the path to the picture is stored in Mysql).
But
> when the string ($stadpict) is empty then it must not display the
picture
> (and also not display a box with a red cross in it (can't display
picture
Hi,
I'm trying to do the following.. When $stadpict is filled in it must display the
picture (only the path to the picture is stored in Mysql). But when the string
($stadpict) is empty then it must not display the picture (and also not display a box
with a red cross in it (can't display picture
On Saturday 25 January 2003 19:18, Frank Keessen wrote:
> Hi,
>
> The register_globals = Off. Dit the basic echo ($submit) but it displays
> nothing..
>
> Any thoughts somebody??
> > If register_globals is not enabled then you need to use $_POST['submit']
>
> (just
>
> > as you had to use $_POST['
Sent: Saturday, January 25, 2003 12:42 PM
Subject: RE: [PHP] If... Else.. I'm not getting it!
> You are using the post method not get so $_GET[] should be empty.
>
> Does this version of your code work?
>
> if(isset($_POST['submit'])) {
> $vname=$_POST[
You are using the post method not get so $_GET[] should be empty.
Does this version of your code work?
Input yourname
Rich
-Original Message-
From: Frank Keessen [mailto:[EMAIL PROTECTED]]
Sent: 25 January 2003 11:33
To: Johannes Schlueter; [EMAIL PROTECTED]
Subject: Re: [PHP] If
iginal Message -
From: "Johannes Schlueter" <[EMAIL PROTECTED]>
To: "Frank Keessen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, January 25, 2003 12:25 PM
Subject: Re: [PHP] If... Else.. I'm not getting it!
Hi,
On Saturday 25 January 2003 12:
Hi,
On Saturday 25 January 2003 12:18, Frank Keessen wrote:
> The register_globals = Off. Dit the basic echo ($submit) but it displays
> nothing..
>
> Any thoughts somebody??
Switch on register_globals or (better!) use $_GET['submit'], $_POST['submit']
or $_REQUEST['submit'].
> Thanks for helpi
IL PROTECTED]>
Sent: Saturday, January 25, 2003 11:36 AM
Subject: Re: [PHP] If... Else.. I'm not getting it!
> On Saturday 25 January 2003 18:27, Frank Keessen wrote:
>
> > But when i'm using IF Else.. Nothing is happening. I'm only seeing the
form
> >
On Saturday 25 January 2003 18:27, Frank Keessen wrote:
> But when i'm using IF Else.. Nothing is happening. I'm only seeing the form
> but when i submit that form: The $vname doen't display..
>
> Here is the code that doesn't work:
>
> $vname=$_POST['vname'];
> if($submit) {
Try some basic debu
Hi all,
Please can you help me with the following:
If got a little sample code:
This one is working (!):
Input yourname
But when i'm using IF Else.. Nothing is happening. I'm only seeing the form but when i
submit that form: The $vname doen't display..
Here is the code that doesn't wo
I've got the following bit of code for an upload/feedback form.. Upload isn't a
required field, but name, email and message are.. When someone submits this form
with an upload used, it works fine.. But if an upload is excluded and they only
fill in the required fields, I don't get an email..
I'm
I have it. I actually got it!
I had the if statement in the wrong place.
Here is what I did:
if($quantity <1)
{
echo "Sorry I can't seem to locate this item";
}
else
{
//check if form has been submitted
if($submit)
{
}
else
{
//if the form has not been submitted run the following
echo ""
ril 23, 2002 10:26 am
Subject: Re: [PHP] If else question
> Ok I have hard coded $quantity so it does = 0 and else still prints.
> "Maxim Maletsky )" <[EMAIL PROTECTED]> wrote in message
> 004701c1eaf1$c915c6b0$92e3021a@machine52">news:004701c1eaf1$c915c6b0$92e3021a@ma
prints, then you are missing something in your query.
> > Otherwise you've got something wrong in your code.
> >
> >
> >
> >
> >
> > Sincerely,
> >
> > Maxim Maletsky
> > Founder, Chief Developer
> >
> > www.PHPBeginner.
another try.
I looks to me as if one row executes the IF and another one the ELSE
Statement ( try to let the script die(); after one the first while.
red
-Ursprüngliche Nachricht-
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 23. April 2002 8:31 PM
An: [EMAIL PRO
Aeh, sorry - but is the 1 you test for actual a number or is it a string?
I had made this mistakes earlier, so also try
if ( $quantity == "1")
Maybe I´m absolutely wrong, (PHP 3 knowledge) but
Oliver
At 23.04.2002 10:48, you wrote:
>Ok you asked for it.
>Don't say I didn't warn you.
>
>ses
've got something wrong in your code.
>
>
>
>
>
> Sincerely,
>
> Maxim Maletsky
> Founder, Chief Developer
>
> www.PHPBeginner.com // where PHP Begins
>
>
>
>
> -Original Message-----
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
>
> >
> > ----- Original Message -
> > From: Jennifer Downey <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, April 23, 2002 12:48 PM
> > Subject: Re: [PHP] If else question
> >
> >
> > Ok you asked for it.
] If else question
Ok you asked for it.
Don't say I didn't warn you.
session_start();
$query = "SELECT name FROM {$config["prefix"]}_users WHERE
uid={$session["uid"]}"; $ret = mysql_query($query); while($row =
mysql_fetch_array($ret)) {
$user = $row[
n valid data?
>
> - Original Message -
> From: Jennifer Downey <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April 23, 2002 12:48 PM
> Subject: Re: [PHP] If else question
>
>
> Ok you asked for it.
> Don't say I didn't wa
d out all the values fetched via mysql_fetch_array()
to ensure they contain valid data?
- Original Message -
From: Jennifer Downey <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 12:48 PM
Subject: Re: [PHP] If else question
Ok you asked for
TECTED]
Subject: Re: [PHP] If else question
Ok you asked for it.
Don't say I didn't warn you.
session_start();
$query = "SELECT name FROM {$config["prefix"]}_users WHERE
uid={$session["uid"]}"; $ret = mysql_query($query); while($row =
mysql_fetch_array($
: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
Ok you asked for it.
Don't say I didn't warn you.
session_start();
$query = "SELECT name FROM {$config["prefix"]}_users WHERE
uid={$session["uid"]}"; $ret = mysql_query($query); while($row =
mysql_
ot;;
echo "";
echo "";
}
?>
-
Sincerely,
Maxim Maletsky
Founder, Chief Developer
www.PHPBeginner.com // where PHP Begins
-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002
Ok you asked for it.
Don't say I didn't warn you.
session_start();
$query = "SELECT name FROM {$config["prefix"]}_users WHERE
uid={$session["uid"]}";
$ret = mysql_query($query);
while($row = mysql_fetch_array($ret))
{
$user = $row['name'];
$query = "SELECT uid, id, iname, image, quantity, typ
]
Subject: Re: [PHP] If else question
No this is the first if statement but there are nested if's after that. I'd
post the code but everyone yells at me about my coding style.
If you promise not to yell I will post it.
Jennifer
"-Bd-" <[EMAIL PROTECTED]> wrote in message
00
]]
Sent: Tuesday, April 23, 2002 7:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
No this is the first if statement but there are nested if's after that.
I'd post the code but everyone yells at me about my coding style. If you
promise not to yell I will post it.
Jen
r
www.PHPBeginner.com // where PHP Begins
-Original Message-
From: Richard Emery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 7:41 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Fw: [PHP] If else question
OK...this has dragged on...
Jennifer, show us your ACTUAL code,
23, 2002 12:17 PM
Subject: Re: [PHP] If else question
No this is the first if statement but there are nested if's after that. I'd
post the code but everyone yells at me about my coding style.
If you promise not to yell I will post it.
Jennifer
"-Bd-" <[EMAIL PROTECTED]> wr
TECTED]">news:001d01c1eae9$d58f4360$[EMAIL PROTECTED]...
> Is this a nested if? (inside another if statement?)
>
>
>
>
> - Original Message -
> From: "Jennifer Downey" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, April
Is this a nested if? (inside another if statement?)
- Original Message -
From: "Jennifer Downey" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 1:05 PM
Subject: Re: [PHP] If else question
>
> I just looked at my hosting ser
then it may be a problem
> with your parser. That's not really my area of expertise, but it's
> something you could look into if no one else has any better ideas :-)
>
> -Natalie
>
> -Original Message-
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
> Sent:
expertise, but it's
something you could look into if no one else has any better ideas :-)
-Natalie
-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 12:26 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
It shows both.
> -Original Message-
> From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 12:23 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] If else question
>
>
>
> > If and else expect to be followed by exactly 1 statement. To aggregate
>
Does it show the message and the form or just the message?
-Natalie
-Original Message-
From: Jennifer Downey [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 12:23 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] If else question
> If and else expect to be followed by exactl
> If and else expect to be followed by exactly 1 statement. To aggregate
> multiple statements as one, surround them with {curly braces}. I'm
> guessing you didn't do that, and you're seeing the execution of all but
> the first of the statements following the else.
>
> So it should be:
>
> if (
On Tue, 23 Apr 2002, Jennifer Downey wrote:
> I am wondering. When you use an if else statement and a condition exists
> isn't the if part suppose to stop?
> Then if the condition doesn't exist it is suppose to do something else?
>
> I am wondering because I have a form that goes something like t
Hi all,
I am wondering. When you use an if else statement and a condition exists
isn't the if part suppose to stop?
Then if the condition doesn't exist it is suppose to do something else?
I am wondering because I have a form that goes something like this.
select such and such from the table
if
On Thu, 14 Mar 2002, Brad Harriger wrote:
>
> // Now back to the PHP code
>
>$d = 250;
> }
> else {
>$e = "Does not apply."
> }
>
> ?>
>
> I have some code similar to this example. When I run the code in my
> browser, I get a parse error on the last line (?>).
Replace:
$e = "Does no
l Message-
From: Brad Harriger [mailto:[EMAIL PROTECTED]]
Sent: 14 ÂÅÒÅÚÎÑ 2002 Ò. 10:52
To: [EMAIL PROTECTED]
Subject: [PHP] If...Else question
Is it legal for an if...else statement to span PHP code blocks? Here's
an example:
MORE HTML CODE HERE
I have some code similar to
Is it legal for an if...else statement to span PHP code blocks? Here's
an example:
MORE HTML CODE HERE
I have some code similar to this example. When I run the code in my
browser, I get a parse error on the last line (?>).
--
PHP General Mailing List (http://www.php.net/)
To u
On Sunday 23 December 2001 03:11 pm, Robert Dyke wrote:
> <% If $varA == True Then %>
> Straight HTML in here that only displays if $varA == True
> <% Else %>
> Straight HTML in here that only displays if $varA != True
> <% End if %>
$varA was true.
$varA was false.
I heavily dislike this cod
I apologize for not including all of the information. I did this as an
include file, which explains why it isn't working:
< !--- beginning of myinclude.php >
< ! --- end of myinclude.php --- >
< ! beginning of testfile.php --- >
Html here that should display only if $varA == Tr
At 01:11 PM 12/23/2001 -0700, Robert Dyke wrote:
>Hello:
>
>In ASP I can write a Conditional statement like this:
>
><% If $varA == True Then %>
>Straight HTML in here that only displays if $varA == True
><% Else %>
>Straight HTML in here that only displays if $varA != True
><% End if %>
>
>Transl
Took a better look at your code -- you've capitalized "true" -- that may be
it.
Bogdan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
What's the error, just a parse error on line xx?
O tend to do a lot of echo 'ing, so this suggestion may not be much help.
How about adding a semicolon?
Miles
At 01:11 PM 12/23/2001 -0700, Robert Dyke wrote:
>Hello:
>
>In ASP I can write a Conditional statement like this:
>
><% If $varA == True
Make sure you close the accolade afterwords in PHP -- other than that, yes,
it works just fine!
For example this should work just fine:
-
Found a multiple of three!
--
Bogdan
Robert Dyke wrote:
> Hello:
>
> In ASP I can write a Conditional statement like this:
>
> <% If $va
Hello:
In ASP I can write a Conditional statement like this:
<% If $varA == True Then %>
Straight HTML in here that only displays if $varA == True
<% Else %>
Straight HTML in here that only displays if $varA != True
<% End if %>
Translating this to PHP doesn't work:
// error is generated he
: Friday, April 27, 2001 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP] if else and or ?
Hello,
I started to do a php page with mysql connection..
My problem is:
I do query from a mysql, I try to setup usernames + passwords
to protect the database
They would need to use specific user+password
Hello,
I started to do a php page with mysql connection..
My problem is:
I do query from a mysql, I try to setup usernames + passwords
to protect the database
They would need to use specific user+password+cities to be able to connect.
Bad passwd would just print an access denied messsage..
ht
I'm not sure if I'm understanding correctly, but you might
take a look at this modification...
Notice: all lines with a > in front of them have remained
unchanged. Lines that can safely be deleted are preceeded by
single-line comments (//), and lines without a > are newly
added lines.
$allFields
Hi all,
I am having 5 rows in a mysql database related to five
different users. these rows contains their firstname,
lastname and details of scenes 1 to 5(these details
are numeric values from 1 to 3). if any of these
fields from scenes 1 to 5 are empty that will be
detected from the firstname of
81 matches
Mail list logo