473,378 Members | 1,388 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Array Concatenation

Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types". They look essentially the same to me. One
thing just occurred to me, though. The $x example is running under
v4.3.6; the other is v4.3.0. Would this make any difference?

$x[1] = $x[1] + $z;

$ExpiringSubs[$CustID] = $ExpiringSubs[$CustID] + $dbRec;

================================================== ========

var_dump($x)
array(1) {
[1]=>
array(3) {
["a"]=> string(1) "A"
["b"]=> string(1) "B"
["c"]=> string(1) "z"
}
}

var_dump($z)
array(2) {
["c"]=> string(1) "C"
["d"]=> string(1) "D"
}

var_dump($ExpiringSubs) [one element]
array(132) {
[113774]=>
array(7) {
["CustID"]=> string(6) "113774"
["Renew"]=> string(10) "2004-04-06"
["Email"]=> string(19) "xx******@xxxx.com"
["Offer"]=> string(2) "19"
["Response"]=> string(10) "SWW1B03A3A"
["DeliveryMode"]=> string(1) "1"
["TermEnds"]=> string(10) "1081224000"
}

var_dump($dbRec)
array(13) {
["FirstName"]=> string(4) "XXXX"
["LastName"]=> string(4) "XXXX"
["UserName"]=> string(8) "XXXXX"
["Password"]=> string(8) "XXXXX"
["CardID"]=> string(5) "69010"
["CardNum"]=> string(76) "XXXXX"
["CardExp"]=> string(4) "0606"
["Address1"]=> string(20) "XXXX XXXX Lane"
["Address2"]=> string(0) ""
["City"]=> string(10) "XXXXX"
["State"]=> string(2) "IN"
["Postal"]=> string(5) "46077"
["Country"]=> string(2) "US"
}

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #1
7 7687
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types". They look essentially the same to me. One
thing just occurred to me, though. The $x example is running under
v4.3.6; the other is v4.3.0. Would this make any difference?


As soon as I posted this (naturally), it occured to me to try the test
script ($x) under v4.3.0 and see if I got the error. I didn't, so that's
not the issue.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #2
I'm not quite sure but as can be found on many different sites, place
the $index in between ' ' or " " inside the brackets...

So $x['1'] = $x['1'] + $z;

$ExpiringSubs['$CustID'] = $ExpiringSubs['$CustID'] + $dbRec;

Mark...

Alan Little wrote:
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:

Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types". They look essentially the same to me. One
thing just occurred to me, though. The $x example is running under
v4.3.6; the other is v4.3.0. Would this make any difference?

As soon as I posted this (naturally), it occured to me to try the test
script ($x) under v4.3.0 and see if I got the error. I didn't, so that's
not the issue.

Jul 17 '05 #3
Carved in mystic runes upon the very living rock, the last words of Mark
Kuiphuis of comp.lang.php make plain:
Alan Little wrote:
Carved in mystic runes upon the very living rock, the last words of
Alan Little of comp.lang.php make plain:

Can anyone tell me what the difference is between these two
statements? The $x one works, the $ExpiringSubs one tells me "Fatal
error: Unsupported operand types". They look essentially the same to
me. One thing just occurred to me, though. The $x example is running
under v4.3.6; the other is v4.3.0. Would this make any difference?

As soon as I posted this (naturally), it occured to me to try the
test script ($x) under v4.3.0 and see if I got the error. I didn't,
so that's not the issue.


I'm not quite sure but as can be found on many different sites, place
the $index in between ' ' or " " inside the brackets...

So $x['1'] = $x['1'] + $z;

$ExpiringSubs['$CustID'] = $ExpiringSubs['$CustID'] + $dbRec;


Thanks for the reply, but that would make the key a literal string. That
is, it would use dollar-sign-C-u-s-t-I-D as the key.

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #4
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types".


GAAAAAHHHHHHH! SPE! SPE! (Stupid Programmer Error)

$CustID is being extracted from $dbRec, from which you will notice it is
missing -- I hadn't included it in the SELECT clause of the query, thus
it was null.

Thanks for playing, contestants. We have some lovely parting gifts for
you.

--
This life has been recorded before a live studio audience.
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Jul 17 '05 #5
Alan Little wrote:
Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types". They look essentially the same to me. One
thing just occurred to me, though. The $x example is running under
v4.3.6; the other is v4.3.0. Would this make any difference?

$x[1] = $x[1] + $z;
What is in $x[1] now?
Are you sure adding arrays gives the result you expect?

var_dump($x[1] + $z)
array(4) {
["a"]=> string(1) "A"
["b"]=> string(1) "B"
["c"]=> string(1) "z" <= from $x[1]
["d"]=> string(1) "D"
}
$ExpiringSubs[$CustID] = $ExpiringSubs[$CustID] + $dbRec;


You didn't tell us

var_dump($CustID);
--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #6
Alan Little wrote:
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types".


GAAAAAHHHHHHH! SPE! SPE! (Stupid Programmer Error)

$CustID is being extracted from $dbRec, from which you will notice it is
missing -- I hadn't included it in the SELECT clause of the query, thus
it was null.

Thanks for playing, contestants. We have some lovely parting gifts for
you.

Ah! You beat me to it by 15 minutes :-)
Glad you solved your problem.

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #7
"Alan Little" <al**@n-o-s-p-a-m-phorm.com> wrote in message
news:Xn**************************@216.196.97.132.. .
Carved in mystic runes upon the very living rock, the last words of Alan
Little of comp.lang.php make plain:
Can anyone tell me what the difference is between these two statements?
The $x one works, the $ExpiringSubs one tells me "Fatal error:
Unsupported operand types".


GAAAAAHHHHHHH! SPE! SPE! (Stupid Programmer Error)

$CustID is being extracted from $dbRec, from which you will notice it is
missing -- I hadn't included it in the SELECT clause of the query, thus
it was null.

Thanks for playing, contestants. We have some lovely parting gifts for
you.

--
This life has been recorded before a live studio audience.
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/


ROTFLMAO !
I gotta use that line somewhere....!
"8-)
--
Remove the blots from my address to reply
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jonas Galvez | last post by:
Is it true that joining the string elements of a list is faster than concatenating them via the '+' operator? "".join() vs 'a'+'b'+'c' If so, can anyone explain why?
12
by: Treetop | last post by:
I cannot get this array to work. I want to have the game listed until the day after the event, then come off the list. function events() { var today = new Date(); var dayarray=new...
8
by: Mike S. Nowostawsky | last post by:
I tried using the "toUpperCase()" property to change the value of an array entity to uppercase BUT it tells me that the property is invalid. It seems that an array is not considered an object when...
5
by: F. Da Costa | last post by:
Hi, Could it be correct that the following code does *not* work because i'm not using the var arr = new Array("a","b","c"); methodology?? Read through...
11
by: Laphan | last post by:
Hi All I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as...
26
by: JGH | last post by:
How can I check if a key is defined in an associative array? var users = new array(); users = "Joe Blow"; users = "John Doe"; users = "Jane Doe"; function isUser (userID) { if (?????)
8
by: JS | last post by:
I am trying to add an element to an array like this: var ty = ; zz = "ty"; var ab = null; zz+=""; ab = eval(zz); document.write(ab.length);
20
by: Pavel Stehule | last post by:
Hello, Is possible merge two arrays like array + array => array select array_append(array, array); ERROR: function array_append(integer, integer) does not exist
11
by: Leszek | last post by:
Hi I' m trying convert a php array to a javascript array like this: var danevar1 = "<? print $dane1; ?>"; var danearray1= new Array(); danearray1 = danevar1.split(","); var suma1=0; for(var...
3
by: Author | last post by:
I have always been wondering if there is any significant different between doing System.Console.WriteLine("Employee Name = " + employee.FirstName + " " + employee.LastName); and ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.