[PHP] If Statements Array and Notice Undefined Index

2011-03-31 Thread Nicholas Cooper
Good day, I have three arrays A, B and C. Anyone of them might not have the 'id' key set which will give the Notice Undefined index: id. I just wanted to know what the correct approach to this problem would be; without making the code overly complicated to read by introducing a number of if

Re: [PHP] If Statements Array and Notice Undefined Index

2011-03-31 Thread Stuart Dallas
On Thursday, 31 March 2011 at 15:45, Nicholas Cooper wrote: Good day, I have three arrays A, B and C. Anyone of them might not have the 'id' key set which will give the Notice Undefined index: id. I just wanted to know what the correct approach to this problem would be; without making the

Re: [PHP] If Statements Array and Notice Undefined Index

2011-03-31 Thread Nicholas Cooper
On 31 March 2011 15:53, Stuart Dallas stu...@3ft9.com wrote: On Thursday, 31 March 2011 at 15:45, Nicholas Cooper wrote: Good day, I have three arrays A, B and C. Anyone of them might not have the 'id' key set which will give the Notice Undefined index: id. I just wanted to know what

Re: [PHP] elseif statements

2009-05-06 Thread Robert Cummings
On Tue, 2009-05-05 at 22:31 -0700, Jim Lucas wrote: Well, since nobody seems to want to answer your question, I will... :) It has to do with you using an assignment '=' instead of a comparison '==' operator in your condition. He already found the problem and fixed it :) Cheers, Rob. --

Re: [PHP] elseif statements

2009-05-06 Thread Gary
He already found the problem and fixed it :) Correction: His problem was pointed out to him and he was able to follow instructions he he. I think I posted yesterday, but I had the double= in the script earlier, but it was givning inconsisitant answers, however when I changed the = for==

Re: [PHP] elseif statements

2009-05-05 Thread tedd
At 2:57 PM -0400 5/4/09, Gary wrote: I am trying to get this to work, however it only reads the second if statement. I get no error messages, but as I change counties, the % stays the same. Can someone enlighten me, or should I be looking at switch statements? Thanks for your help. Gary In

Re: [PHP] elseif statements

2009-05-05 Thread Robert Cummings
On Tue, 2009-05-05 at 09:49 -0400, tedd wrote: At 2:57 PM -0400 5/4/09, Gary wrote: I am trying to get this to work, however it only reads the second if statement. I get no error messages, but as I change counties, the % stays the same. Can someone enlighten me, or should I be looking at

Re: [PHP] elseif statements

2009-05-05 Thread Robert Cummings
On Tue, 2009-05-05 at 10:05 -0400, Robert Cummings wrote: On Tue, 2009-05-05 at 09:49 -0400, tedd wrote: At 2:57 PM -0400 5/4/09, Gary wrote: I am trying to get this to work, however it only reads the second if statement. I get no error messages, but as I change counties, the % stays the

Re: [PHP] elseif statements

2009-05-05 Thread tedd
At 10:13 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 10:05 -0400, Robert Cummings wrote: On Tue, 2009-05-05 at 09:49 -0400, tedd wrote: At 2:57 PM -0400 5/4/09, Gary wrote: I am trying to get this to work, however it only reads the second if statement. I get no error

Re: [PHP] elseif statements

2009-05-05 Thread Robert Cummings
On Tue, 2009-05-05 at 11:21 -0400, tedd wrote: At 10:13 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 10:05 -0400, Robert Cummings wrote: On Tue, 2009-05-05 at 09:49 -0400, tedd wrote: At 2:57 PM -0400 5/4/09, Gary wrote: I am trying to get this to work, however it

Re: [PHP] elseif statements

2009-05-05 Thread Jan G.B.
2009/5/5 tedd tedd.sperl...@gmail.com: At 10:13 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 10:05 -0400, Robert Cummings wrote:  On Tue, 2009-05-05 at 09:49 -0400, tedd wrote:   At 2:57 PM -0400 5/4/09, Gary wrote:   I am trying to get this to work, however it only reads

Re: [PHP] elseif statements

2009-05-05 Thread tedd
At 11:29 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 11:21 -0400, tedd wrote: At 10:13 AM -0400 5/5/09, Robert Cummings wrote: Just so we all know why... Yep -- just so we know why: http://php1.net/a/if-v-switch/ It all depends upon how you use the tools at

Re: [PHP] elseif statements

2009-05-05 Thread Robert Cummings
On Tue, 2009-05-05 at 12:12 -0400, tedd wrote: At 11:29 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 11:21 -0400, tedd wrote: At 10:13 AM -0400 5/5/09, Robert Cummings wrote: Just so we all know why... Yep -- just so we know why:

Re: [PHP] elseif statements

2009-05-05 Thread Tom Worster
On 5/5/09 9:49 AM, tedd tedd.sperl...@gmail.com wrote: In my opinion, whenever your choices exceed two, use switch. ick! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] elseif statements

2009-05-05 Thread Paul M Foster
On Tue, May 05, 2009 at 12:12:33PM -0400, tedd wrote: At 11:29 AM -0400 5/5/09, Robert Cummings wrote: On Tue, 2009-05-05 at 11:21 -0400, tedd wrote: At 10:13 AM -0400 5/5/09, Robert Cummings wrote: Just so we all know why... Yep -- just so we know why:

Re: [PHP] elseif statements

2009-05-05 Thread tedd
At 12:48 PM -0400 5/5/09, Robert Cummings wrote: I'm not looking for gratification... merely hoping to ensure that readers of your niche style understand that it is niche, and that it is not really the best option of all available options. You are welcome to disagree, your opinion is your own,

Re: [PHP] elseif statements

2009-05-05 Thread tedd
At 1:11 PM -0400 5/5/09, Paul M Foster wrote: I hate to dogpile on Tedd, ... No problem. Some days you're the windshield and some days you're the bug. Hey, I've been wrong before -- I'm used to it. But in my defense, I've always had major problems understanding long ifelse's. You see, I'm

Re: [PHP] elseif statements

2009-05-05 Thread Jim Lucas
Well, since nobody seems to want to answer your question, I will... :) It has to do with you using an assignment '=' instead of a comparison '==' operator in your condition. Follow along with my inline notes below. Gary wrote: I am trying to get this to work, however it only reads the second

[PHP] elseif statements

2009-05-04 Thread Gary
I am trying to get this to work, however it only reads the second if statement. I get no error messages, but as I change counties, the % stays the same. Can someone enlighten me, or should I be looking at switch statements? Thanks for your help. Gary ?php

Re: [PHP] Prepared statements

2006-03-08 Thread Julius Hacker
Curt Zirzow wrote: On Mon, Mar 06, 2006 at 10:03:10PM +0100, Julius Hacker wrote: Curt Zirzow wrote: I assume your loop is something like: while(condition) { $auction_parts['id'] = 'some value'; $auction_parts['name'] = 'some value'; ...

Re: [PHP] Prepared statements

2006-03-07 Thread Julius Hacker
Anthony Ettinger wrote: On 3/6/06, Anthony Ettinger [EMAIL PROTECTED] wrote: On 3/6/06, Julius Hacker [EMAIL PROTECTED] wrote: Curt Zirzow wrote: I assume your loop is something like: while(condition) { $auction_parts['id'] = 'some value'; $auction_parts['name']

Re: [PHP] Prepared statements

2006-03-07 Thread Curt Zirzow
On Mon, Mar 06, 2006 at 10:03:10PM +0100, Julius Hacker wrote: Curt Zirzow wrote: I assume your loop is something like: while(condition) { $auction_parts['id'] = 'some value'; $auction_parts['name'] = 'some value'; ... $insert-execute(); } Yes, thats it.

Re: [PHP] Prepared statements

2006-03-06 Thread Julius Hacker
Curt Zirzow wrote: I assume your loop is something like: while(condition) { $auction_parts['id'] = 'some value'; $auction_parts['name'] = 'some value'; ... $insert-execute(); } Yes, thats it. My first guess would be, if not aleady done, initialize $auction_parts

Re: [PHP] Prepared statements

2006-03-05 Thread chris smith
MySQL returns Column 'auction_house' cannot be null. Here're some parts of my code: --- code --- $update = $this-sql-stmt_init(); $update-prepare(UPDATE auctions SET name=?, auction_house=?, link=?, prize=?, runtime=?, bids=?, picture=? WHERE link=?); $update-bind_param(sisdsiss,

Re: [PHP] Prepared statements

2006-03-05 Thread Julius Hacker
chris smith wrote: So at some point the $auction_parts['id'] is empty. As you go into the loop, print out the $auction_house[id], then work backwards... I output already some variables in the loop and all are set with correct values. As I said, if I do the bind_param inside the

Re: [PHP] Prepared statements

2006-03-05 Thread Curt Zirzow
On Sun, Mar 05, 2006 at 04:03:17AM +0100, Julius Hacker wrote: On 3/4/06, Julius Hacker [EMAIL PROTECTED] wrote: Before that foreach, I use mysqli_stmt_init, mysql_stmt_prepare and mysql_stmt_bind_param. In the foreach-loop I give the variables, which I bound with bind_param,

Re: [PHP] Prepared statements

2006-03-05 Thread Anthony Ettinger
On 3/5/06, Curt Zirzow [EMAIL PROTECTED] wrote: On Sun, Mar 05, 2006 at 04:03:17AM +0100, Julius Hacker wrote: On 3/4/06, Julius Hacker [EMAIL PROTECTED] wrote: Before that foreach, I use mysqli_stmt_init, mysql_stmt_prepare and mysql_stmt_bind_param. In the foreach-loop I give

Re: [PHP] Prepared statements

2006-03-04 Thread Julius Hacker
One other thing: If I do the bind_param within the loop, it just works. The curious is that I have to prepared statements for this loop (one for inserting data and one for updating data) and the one for updating data works and that for inserting don't. Both statements are 100% valid. Julius

Re: [PHP] Prepared statements

2006-03-04 Thread Anthony Ettinger
On 3/4/06, Julius Hacker [EMAIL PROTECTED] wrote: One other thing: If I do the bind_param within the loop, it just works. The curious is that I have to prepared statements for this loop (one for inserting data and one for updating data) and the one for updating data works and that for

Re: [PHP] Prepared statements

2006-03-04 Thread Julius Hacker
Anthony Ettinger wrote: On 3/4/06, Julius Hacker [EMAIL PROTECTED] wrote: One other thing: If I do the bind_param within the loop, it just works. The curious is that I have to prepared statements for this loop (one for inserting data and one for updating data) and the one for updating

[PHP] Prepared statements

2006-03-03 Thread Julius Hacker
Hi, so I need help again: I want to use prepared statements to insert lots of data in my MySQL-database. For that I use foreach because I have an array containing all necessary information. Before that foreach, I use mysqli_stmt_init, mysql_stmt_prepare and mysql_stmt_bind_param. In the

Re: [PHP] Prepared statements

2006-03-03 Thread Anthony Ettinger
are you executing the statement in your loop too? On 3/3/06, Julius Hacker [EMAIL PROTECTED] wrote: Hi, so I need help again: I want to use prepared statements to insert lots of data in my MySQL-database. For that I use foreach because I have an array containing all necessary information.

[PHP] setcookie statements are giving me error

2004-04-14 Thread Ryan Schefke
I'm trying to set multiple cookies and getting the error below. I removed all of the white spaces and extra lines before and after my ?php and ?, so, that shouldn't be an issue. I get the error for each cookie and it echoes back as ...cookie not set like I coded. This is the code chunk I'm

Re: [PHP] setcookie statements are giving me error

2004-04-14 Thread Curt Zirzow
* Thus wrote Ryan Schefke ([EMAIL PROTECTED]): cannot modify header errors, which tells me there's nothing wrong with my main script. Am I doing something wrong with cookies here? Warning: Cannot modify header information - headers already sent by. You're missing the most important

RE: [PHP] setcookie statements are giving me error

2004-04-14 Thread Ryan Schefke
, April 14, 2004 3:29 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] setcookie statements are giving me error * Thus wrote Ryan Schefke ([EMAIL PROTECTED]): cannot modify header errors, which tells me there's nothing wrong with my main script. Am I doing something wrong with cookies here

[PHP] echo statements

2003-07-18 Thread Jay Fitzgerald
When echoing html code that will include variables from a while or if loop, which method is best? Method 1: echo td align=\left\ VALIGN=\top\font class=\dbtables\$employer/font/td; OR Method 2: td align=left valign=topfont class=dbtables?php echo $employer; ?/font/td If you would, please give

Re: [PHP] echo statements

2003-07-18 Thread Chris Shiflett
--- Jay Fitzgerald [EMAIL PROTECTED] wrote: When echoing html code that will include variables from a while or if loop, which method is best? ... Method 1: echo td align=\left\ VALIGN=\top\font class=\dbtables\$employer/font/td; OR Method 2: td align=left valign=topfont class=dbtables?php

Re: [PHP] echo statements

2003-07-18 Thread Curt Zirzow
Jay Fitzgerald [EMAIL PROTECTED] wrote: When echoing html code that will include variables from a while or if loop, which method is best? Method 1: echo td align=\left\ VALIGN=\top\font class=\dbtables\$employer/font/td; OR Method 2: td align=left valign=topfont class=dbtables?php echo

[PHP] variable statements

2002-06-26 Thread Henning Sittler
Question: Variable variables and variable functions work great, but how can you execute arbitrary code statements using php code stored inside variables? // Example function stuff() { echo 'pStuff/p'; } // end stuff() $function = 'stuff'; $function(); // works /* Given the above, I

Re: [PHP] variable statements

2002-06-26 Thread Jason Wong
On Thursday 27 June 2002 01:34, Henning Sittler wrote: Question: Variable variables and variable functions work great, but how can you execute arbitrary code statements using php code stored inside variables? eval() -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source

RE: [PHP] variable statements

2002-06-26 Thread Henning Sittler
Perfect. Thank you Jason. Henning Sittler www.inscriber.com -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 26, 2002 1:44 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] variable statements On Thursday 27 June 2002 01:34, Henning Sittler wrote

[PHP] if() statements

2002-06-06 Thread Justin French
the process of PHP digging it's way through multiple nested if() statements slow down PHP, perhaps in comparison to a single line with an include? eg ? if($something) { // // 100 lines of code, queries and nested if()'s // } ? versus ? if($something) { include

Re: [PHP] if() statements

2002-06-06 Thread Analysis Solutions
digging it's way through multiple nested if() statements slow down PHP, perhaps in comparison to a single line with an include? If() statements definitely slow programs down. BUT, the size of the code inside the if satement isn't the real issue. It's the process of making the true/false

RE: [PHP] IF Statements

2002-05-16 Thread Patrick Lynch
15:04 To: '[EMAIL PROTECTED]' Subject: [PHP] IF Statements People, hope you can help. The below IF statement is getting a PARSE error. Can anyone spot why? Cheers. Jon if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) (!$this-checkLocation($this-post, W

[PHP] IF Statements

2002-05-15 Thread Jon Yates
People, hope you can help. The below IF statement is getting a PARSE error. Can anyone spot why? Cheers. Jon if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) (!$this-checkLocation($this-post, W)) (!empty($this-childDOB))) ||

Re: [PHP] IF Statements

2002-05-15 Thread Rasmus Lerdorf
Your brackets don't match up. Use an editor that lets you do bracket-matching. Hit '%' in vi, for example. -Rasmus On Wed, 15 May 2002, Jon Yates wrote: People, hope you can help. The below IF statement is getting a PARSE error. Can anyone spot why? Cheers. Jon if

Re: [PHP] IF Statements

2002-05-15 Thread Steven Apostolou
if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) (!$this-checkLocation($this-post, W)) (!empty($this-childDOB))) || ($this-checkPregnancy($this-benefitRef, $this-benefitNo)) must be: if (($this-checkReferralCB($this-benefitRef, $this-benefitNo,

Re: [PHP] IF Statements

2002-05-15 Thread Michal Dvoracek
Hello, try this version :) if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) (!$this-checkLocation($this-post, W)) (!empty($this-childDOB)) || ($this-checkPregnancy($this-benefitRef, $this-benefitNo))) Regards, Michal Dvoracek [EMAIL

RE: [PHP] IF Statements

2002-05-15 Thread Jay Blanchard
[snip] People, hope you can help. The below IF statement is getting a PARSE error. Can anyone spot why? if (($this-checkReferralCB($this-benefitRef, $this-benefitNo, $this-childDOB)) (!$this-checkLocation($this-post, W)) (!empty($this-childDOB))) ||

Re: [PHP] IF Statements

2002-05-15 Thread 1LT John W. Holmes
, but this will help you on large statements like this to make sure your logic and syntax is correct. ---John Holmes... - Original Message - From: Jon Yates [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, May 15, 2002 10:03 AM Subject: [PHP] IF Statements People, hope you can help

[PHP] Case Statements - lil help please

2002-03-30 Thread Patrick Hartnett
Are case statements not implemented in PHP4? If so, can someone help me debug this one, I seem to have some syntax incorrect, and am not sure what exactly is wrong with the statement. I get a parse error on the first line, but can't find any documentation on case statements in PHP4, so I am

Re: [PHP] Case Statements - lil help please

2002-03-30 Thread Dennis Moore
.; break; default: $message = An unspecified error occurred.; break; } - Original Message - From: Patrick Hartnett [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, March 31, 2002 12:03 AM Subject: [PHP] Case Statements - lil help please Are case statements

[PHP] IF Statements

2002-01-13 Thread Necro
I have a page for listing the contents of a table from my db. Being client.php?action=list As the action variable also allows for adding extra to the table, etc. Once I use ?action=list I want to be able to click on a single record and have it give me the extended info. so

Re: [PHP] IF Statements

2002-01-13 Thread Bogdan Stancescu
if ($action=='list') { if (!$clientcode) { old_code } else { new_code } } I put the $clientcode test inside the $action test because I suppose you take different actions on $clientcode depending on $action - if that's not the case, simply switch the two if's. This assumes that

Re: [PHP] IF Statements

2002-01-13 Thread James Mclean
Hi, My problem is working out how to evaluate this new part. I have normal If statements for the listing, adding, etc. But how can I get it to check if clientcode is present. If clientcode is not present I want it to load the list page as normal. But if the clientcode is present then it

RE: [PHP] IF Statements

2002-01-13 Thread Martin Towell
To: [EMAIL PROTECTED] Subject: [PHP] IF Statements I have a page for listing the contents of a table from my db. Being client.php?action=list As the action variable also allows for adding extra to the table, etc. Once I use ?action=list I want to be able to click on a single record and have it give me

[PHP] Print statements , syntax , usage, etc

2001-10-22 Thread Ricardo Fitzgerald
Hi, ¡'m new to php, but not to programming, I'm having problems using a simple print statement : *print 'td width=25% bgcolor=#FcaF00bfont face=Tahoma, Verdana, Arial, Sans SerifRef:/fontb//td';* *print 'td width=25% bgcolor=#00bfont face=Tahoma, Verdana, Arial, Sans

[PHP] while statements output to variables

2001-05-23 Thread adam
i need to write a while statement to a variable that will later be echoed again on another page after including this file to it. i need to repeat a statement over and over in it and i do not know how. ?php $variable = 'table tr td' . do { 'fontdata to be outputted/font' }while ($something

Re: [PHP] while statements output to variables

2001-05-23 Thread David Robley
On Thu, 24 May 2001 10:40, adam wrote: i need to write a while statement to a variable that will later be echoed again on another page after including this file to it. i need to repeat a statement over and over in it and i do not know how. ?php $variable = 'table tr td' . do {

[PHP] IF statements

2001-05-22 Thread chris herring
Ok, use your imaginations and visualize what I'm trying to do with this, because I'm not quite sure how to explain it. Anyway, I'm trying to have a script that says when THIS_VAR and THAT_VAR are a certain number it show something. I'm not quite sure how to do that without making yet another

RE: [PHP] IF statements

2001-05-22 Thread Peter Houchin - SunRentals Australia
What's wrong with doing it like if ($date == 24) { if ($hour == 3) { do something } } ?? -Original Message- From: chris herring [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 23, 2001 12:58 PM To: [EMAIL PROTECTED] Subject: [PHP] IF statements

RE: [PHP] IF statements

2001-05-22 Thread Maxim Maletsky
Begins) [EMAIL PROTECTED] www.phpbeginner.com -Original Message- From: chris herring [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 23, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: [PHP] IF statements Ok, use your imaginations and visualize what I'm trying to do with this, because

Re: [PHP] IF statements

2001-05-22 Thread Steve Werby
chris herring [EMAIL PROTECTED] wrote: if ($date == 24 $hour == 3) { } But that doesn't work... Any help is appreciated Your logic is correct. If the code within the braces isn't working it's likely there's either an error in the code within the braces or $date and $hour aren't returning