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
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
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
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.
--
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==
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
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
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
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
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
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
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
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:
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
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:
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,
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
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
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
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';
...
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']
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.
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
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,
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
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,
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
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
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
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
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
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.
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
* 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
, 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
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
--- 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
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
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
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
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
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
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
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
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)))
||
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
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,
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
[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)))
||
, 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
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
.;
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
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
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
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
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
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
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
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 {
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
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
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
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
63 matches
Mail list logo