Hi!
Under PHP 4.3.10, the following simple code behaves as expected: $b[1]
and $c are not modified by the final assignment to $a[1]:
Code 1:
$a[1] = 1;
$b[1] = 2;
$c = 3;
$a = $b;
$a[1] = 7;
// resulting mappings:
// $a[1] ... 7
// $b[2] ... 2
// $c .. 3
However, the
I usually work with cold fusion and took on a little project to get my
feet wet in php and am spinning my wheels. What I thought might be
difficult was easy and what I thought would be a piece of cake has
caused me much grief over the last few days.
I'm making a little shopping basket, writing
On Tuesday 17 May 2005 21:18, mayo wrote:
I usually work with cold fusion and took on a little project to get my
feet wet in php and am spinning my wheels. What I thought might be
difficult was easy and what I thought would be a piece of cake has
caused me much grief over the last few days.
Wong [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 17, 2005 5:56 PM
To: php-general@lists.php.net
Subject: Re: [PHP] array, trouble updating
On Tuesday 17 May 2005 21:18, mayo wrote:
I usually work with cold fusion and took on a little project to get my
feet wet in php and am spinning my wheels
Yikes,
Who would have thought something so easy would be such a pain in the
butt.
I solved it with embedded if-else clauses.
Thx all
-Original Message-
From: mayo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 17, 2005 9:19 AM
To: 'php'
Subject: [PHP] array, trouble updating
I
On Fri, May 6, 2005 7:03 am, blackwater dev said:
Hello,
Is there a good way to get the difference in two arrays and have both
values returned? I know I can use array_dif to see what is in one and
not the other but...I need it to work a bit differently.
I believe you want array_union
Hi there,
I
need help with arrays. What I want to do is to have an array of the following
structure:
$mod=array(
name=new NameObject());
Then
later in the page I want to go $Site = $mod[$_GET[module]] (or something
like that) to instantiate a new object.
Thomas Hochstetter wrote:
Spiraleye.Studios
Hi there,
I need help with arrays. What I want to do is to have an array of the
following structure:
$mod=array( name=new NameObject());
^ -- looks like your single quotes got mangled in my email client.
class Test { function Test($str
-general@lists.php.net
Subject: Re: [PHP] Array of objects
Thomas Hochstetter wrote:
Spiraleye.Studios
Hi there,
I need help with arrays. What I want to do is to have an array of the
following structure:
$mod=array( 'name'=new NameObject());
^ -- looks like your single quotes got
Thanks, will do ;-) (as of this mail)
-Original Message-
From: Jochem Maas [mailto:[EMAIL PROTECTED]
Sent: 06 May 2005 03:08 PM
To: Thomas Hochstetter
Cc: [php] PHP General List
Subject: Re: [PHP] Array of objects
Thomas Hochstetter wrote:
Hi Jochem,
Thanks for that. The eval story
Hello,
Is there a good way to get the difference in two arrays and have both
values returned? I know I can use array_dif to see what is in one and
not the other but...I need it to work a bit differently.
I have:
$array1=array(name=fred,gender=m,phone==555-);
Is there a good way to get the difference in two arrays and have both
values returned? I know I can use array_dif to see what is in one and
not the other but...I need it to work a bit differently.
I have:
$array1=array(name=fred,gender=m,phone==555-);
On Monday 25 April 2005 20:24, Ed Dorsch wrote:
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three files
-- tree.jpg, house.jpg and boat.jpg -- can PHP look at the file and
generate a variable $photos= array (tree,
Ed Dorsch wrote:
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three
files -- tree.jpg, house.jpg and boat.jpg -- can PHP look at the
file and generate a variable $photos= array (tree, house,boat).
Any ideas for how to
Mark Sargent wrote:
Ed Dorsch wrote:
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three
files -- tree.jpg, house.jpg and boat.jpg -- can PHP look at the
file and generate a variable $photos= array (tree, house,boat).
Can PHP generate an
array based on file names in a folder?
For example, if I
have a folder called "photos" that includes three files -- tree.jpg, house.jpg
and boat.jpg -- can PHP "look" at the file and generate a variable $photos=
array("tree", "house","boat"). Any ideas for how to
[snip]
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three
files -- tree.jpg, house.jpg and boat.jpg -- can PHP look at the file
and generate a variable $photos= array (tree, house,boat). Any
ideas for how to sniff out a
Jay Blanchard wrote:
[snip]
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three
files -- tree.jpg, house.jpg and boat.jpg -- can PHP look at the file
and generate a variable $photos= array (tree, house,boat). Any
ideas
I have a sloppy, insecure script that does this posted on the web,
which I use at home to make pages for my personal homepage:
http://kimbriggs.com/computers/computer-software/create-html-table.txt
You seem to be passing variables programmatically. This is how I use it
On Mon, April 25, 2005 10:54 am, Jason Barnett said:
Jay Blanchard wrote:
[snip]
Can PHP generate an array based on file names in a folder?
For example, if I have a folder called photos that includes three
files -- tree.jpg, house.jpg and boat.jpg -- can PHP look at the file
and generate a
Hi there,
I would like to save some db power by putting values into a file which are often
used. They basicly populate a select field.
So I placed those values into associative arrays:
$code[language] = array(1= php, 2= asp);
Now I would like to sort those for displaying after my preference, not
May be this help you:
$data=$_POST['position'];
$positions=array_keys($data);
foreach($positions as $pos){
$row=$data[$pos];
foreach($row as $value){
$sql=INSERT INTO table_name (field_name)VALUES ('$value');
$cursor=mysql_query($sql);
}
}
Devta.
[EMAIL PROTECTED] escribió:
Hi,
I have a form like this:
form action=products.php method=post
input name=position[pos][value 1] type=text id=position[pos][value 1]
value=number 1
input name=position[pos][value 2] type=text id=position[pos][value 2]
value=number 2
input name=position[pos][value 3] type=text
I'm running into the problem of not having a server that gives me database
access or ability to use files to store my data ... Yeah, I know, it
sucks.
If switching servers isn't an option, just pay for another one somewhere,
and then re-direct or something.
The time you save HAS to be worth
Greets,
I'm running into the problem of not having a server that gives me database
access or ability to use files to store my data ... Yeah, I know, it sucks.
Anyway ... My page has a number of profiles about people involved with my
organization and all the profiles load into a set appearance.
On Mon, 2005-03-14 at 18:07, Phil Neeb wrote:
Greets,
I'm running into the problem of not having a server that gives me database
access or ability to use files to store my data ... Yeah, I know, it sucks.
Anyway ... My page has a number of profiles about people involved with my
I have an array with image names like:
$arrayone = array(1.jpg, 2.jpg);
$arraytwo = array(a.jpg, b.jpg);
Then I have a variable for each to count the number of elements:
$arrayoneElements = count($arrayone);
$arraytwoElements = count($arraytwo);
I'm using the element
What I want to do is to only show 20 pictures at a time with a Next link
and a Previous link. For the first 20 only the Next link would show and
whenever the last set would show only the Previous link would. Every other
time both would show.
Can someone point me in the right direction on
Hello All,
I've been trying for days now to make this work.
I'm trying to search my array for a value and return the key.
I get the visitor's IP and try this -- this is the latest,
I've tried a few functions to echo the name associated with the viz_ip.
$viz_ip= $_SERVER['REMOTE_ADDR'];
Malcolm wrote:
Hello All,
I've been trying for days now to make this work.
I'm trying to search my array for a value and return the key.
I get the visitor's IP and try this -- this is the latest,
I've tried a few functions to echo the name associated with the viz_ip.
$viz_ip=
I've been trying for days now to make this work.
This worked for me (with my IP address for 'John'):
?php
$viz_ip= $_SERVER['REMOTE_ADDR'];
echo (Your IP is $viz_ip);
$byte_ip= array(
204.126.202.56=Mark,
63.230.76.166=Bob,
84.196.101.86=John,
);
function _array_search
Thank you Sirs,
I was echoing the viz-ip so I know it was getting set but
I couldn't get it.
both work .. I got the clue from John, the last echo line did the
trick.
On Sun, 23 Jan 2005 17:26:58 +0100, Jochem Maas [EMAIL PROTECTED]
wrote:
Malcolm wrote:
Hello All,
I've been trying
probably missing something but php have a function called array_search.
Ben
On Sun, 23 Jan 2005 11:33:16 -0500 (EST), [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
I've been trying for days now to make this work.
This worked for me (with my IP address for 'John'):
?php
$viz_ip=
hi
if i have an array
$listing1 = array(array('title'='yahoo', 'redirect'='www.yahoo.com',
'info'='yahoo website'), array(title='msn',
'redirect'='www.msn.com', 'info='msn website'));
$listing2 = array(array('name'='lycos', 'link'='www.lycos.com',
'description'='lycos website'),
Ahmed Abdel-Aliem wrote:
how can i group them together into one array to be :
http://php.net/array_merge
and friends should help
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial
conditions, and then a public function that does some work. I want to be
able to call this function from an external array_walk call, but when I
try and reference it as
Tom wrote:
Hi
I'm batting my head against a wall on this one...
I have a class that has a constructor which sets some initial
conditions, and then a public function that does some work. I want to be
able to call this function from an external array_walk call, but when I
try and reference it as
Jochem Maas wrote:
Tom wrote:
snip
Sorry Tom, I hit the send button too early!
I mean to add some context to the code below so you would (hopefully)
understand what I mean:
OR define the function outside of the class e.g.
function aFunction($value, $key)
{
global $aReturnString;
Tom wrote:
Thanks very much for the help - both methods work fine. I'd had a look
at the array_walk manual, but didn't realise that the second param would
accept an array - that's really cool
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used practically
everywhere a callback function is expected, the array you pass can be in
the form of:
array($object, 'methodname')
or
array('classname', 'methodname')
the second version allows you to
Thanks very much for the help - both methods work fine. I'd had a look
at the array_walk manual, but didn't realise that the second param would
accept an array - that's really cool!
I don't like the function_exists method much, as I frequently overload
class members. Not needed now as I have
Jason Barnett wrote:
indeed that page does not make it very clear,
it's the generic call_back syntax, which can be used practically
everywhere a callback function is expected, the array you pass can be
in the form of:
array($object, 'methodname')
or
array('classname', 'methodname')
the second
Hi,
I my system can handle invisible modules, so they can't show in the
menu but stills works... here is the code:
$c = count($modules)-1;
for($i = 0; $i = $c; $i++)
{
if($modules[$i]['moduleVisibility'] == 0)
{
How do I get the data from a mysql database into and array that looks
like this
Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 )
The table has three fields but I only need the data from one field.
$query=SELECT amenityID FROM property_amenity where listingId =
'$listingId';
--
PHP
Richard wrote:
How do I get the data from a mysql database into and array that looks
like this
Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 )
by using mysql_fetch_row() or mysql_fetch_array()
The table has three fields but I only need the data from one field.
$query=SELECT amenityID
* Thus wrote Mike Smith:
I am trying to cache a database recordset so users can sort, etc
without hitting the database everytime. I'm using ADODB to access a
MSSQL database.
I wouldn't even bother with this.
No matter what you do your going to have to retreive the data
somewhere, aka
I am trying to cache a database recordset so users can sort, etc
without hitting the database everytime. I'm using ADODB to access a
MSSQL database.
$s = SELECT id, part, description FROM parts\n;
$r = $db-Execute($s);
$parts = array(id=array(),part=array(),desc=array())
while(!$r-EOF){
Mike Smith wrote:
I am trying to cache a database recordset so users can sort, etc
without hitting the database everytime. I'm using ADODB to access a
MSSQL database.
$s = SELECT id, part, description FROM parts\n;
$r = $db-Execute($s);
$parts = array(id=array(),part=array(),desc=array())
way to manage this as sometime value may be too long
to store in $_GET variable.
Do You get any error on unserialization?
Zareef ahmed
-Original Message-
From: Mike Smith [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 10, 2004 10:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Array
Hi,
I have an variable that contains an array like this:
[0] = Array(
[0] = Array([0] = {3 3})
[1] = Array([0] = 3)
)
[1] = Array(
[0] = Array([0] = {3 3})
[1] = Array([0] = 3)
)
[2] = Array(
[0] = Array(
[snip]
[2] = Array(
[0] = Array(
[0] = {textlinks 0_15}
[1] = {textlinks 16_30}
)
[1] = Array(
[0] = 0_15
[1] = 16_30
)
)
As you can see
Hi,
I have a line of php that I don't really understand.
foreach($this-orders as $OrderID = $value) {
echo $OrderID.BR;
$OrderObject =$this-orders[$OrderID=$value];
echo $OrderObject-OrderID.--all the sameBR;
}
I know that $this-orders is an array of order objects.
the result i get
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It looks like what it's meant to say is:
$OrderObject = $this-orders[$OrderID];
But this will just set $OrderObject equal to $value, so you should
But why would the this line generate different OrderID on lines 1 and 3?
Ben Ramsey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It
Ben Ramsey wrote:
Victor C. wrote:
$OrderObject =$this-orders[$OrderID=$value];
This line is confusing. $OrderID=$value is either a typo or is just
plain wrong. It looks like what it's meant to say is:
$OrderObject = $this-orders[$OrderID];
But this will just set $OrderObject equal to
I did a print_r(array_values)before calling the codes that had errors in
it.. the following content is contained in $this-orders;
Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] =
E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile]
= resources/footer.php
Victor C. wrote:
I did a print_r(array_values)before calling the codes that had errors in
it.. the following content is contained in $this-orders;
Aaaghh. Can you give that to us in pre-formatted text, rather than
copying and pasting it from the browser. My eyes are going everywhere
trying
Hi Ben,
I tried your portion of code and find out what was wrong... Apparently I
used in adding order to the array and that was messing things up...
Everything is working now.
Thanks for all the help
Victor C. [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I did a
-Original Message-
From: Victor C. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 02, 2004 3:06 AM
To: [EMAIL PROTECTED]
Subject: [PHP] php array question
Hi,
I have a line of php that I don't really understand.
foreach($this-orders as $OrderID = $value) {
echo $OrderID.BR;
I
Just a heads up on this change in array concatenation behaviour that
could cause a few probs for some people...
?
$arr1 = array(0 = 'Zero');
$arr2 = array(1 = 'One',2 = 'Two');
$arr2 = $arr1 + $arr2;
echo phpversion().'br /';
print_r($arr2);
?
this code produces on our provider's server...
Can't you sort the array?
On 8 Oct 2004, at 10:41, rich gray wrote:
Just a heads up on this change in array concatenation behaviour that
could cause a few probs for some people...
?
$arr1 = array(0 = 'Zero');
$arr2 = array(1 = 'One',2 = 'Two');
$arr2 = $arr1 + $arr2;
echo phpversion().'br /';
Can't you sort the array?
Yes of course but that wasn't the point of my post I was trying to
show that the same code produces differing results on 2 different
versions of PHP ...
rich
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, 1 Oct 2004 22:44:50 -0400, Paul Bissex [EMAIL PROTECTED] wrote:
On Fri, 1 Oct 2004 19:12:30 -0700, Ed Lazor [EMAIL PROTECTED] wrote:
Any ideas on how I could sort this array by Title?
$menu[1][ID] = 5;
$menu[1][Title] = Test 1;
$menu[2][ID] = 3;
$menu[2][Title] = Test 4;
Sorry for the empty reply (miss slide of the finger on my touch pad).
You can use array_multisort(); The code would look something like
this, remember, this is untested code so be warned before any flaming
is done:
//CODE
//You need to restructure your array like this:
$menu[ID][1] = 5;
Thanks for the example using array_multisort. I'd been wondering how I
could use that function to do what I want. It looks like it's more flexible
in the long run, but I was able to use Paul's recommendation to do what I
want. Here's the code I ended up using:
function cmp ($a, $b) {
Any ideas on how I could sort this array by Title?
$menu[1][ID] = 5;
$menu[1][Title] = Test 1;
$menu[2][ID] = 3;
$menu[2][Title] = Test 4;
$menu[3][ID] = 56;
$menu[3][Title] = Test 8;
$menu[4][ID] = 44;
$menu[4][Title] = Test 3;
Thanks,
-Ed
On Fri, 1 Oct 2004 19:12:30 -0700, Ed Lazor [EMAIL PROTECTED] wrote:
Any ideas on how I could sort this array by Title?
$menu[1][ID] = 5;
$menu[1][Title] = Test 1;
$menu[2][ID] = 3;
$menu[2][Title] = Test 4;
uasort() is what you need here.
Also see the usort() documentation page
Hello everybody,
can anyone explain to me, why I can't resize an array inside a class?
Sample Code:
?php
class Liste {
var $input = array (1,2,3);
var $input2 = array_pad ($input,10, 1);
}
?
Output:
Parse error: parse error, unexpected '(', expecting ',' or ';' in
On Fri, 10 Sep 2004 20:09:55 +0200, dirk [EMAIL PROTECTED] wrote:
can anyone explain to me, why I can't resize an array inside a class?
Sample Code:
?php
class Liste {
var $input = array (1,2,3);
var $input2 = array_pad ($input,10, 1);
}
?
Output:
Parse error: parse error,
From the manual:
In PHP 4, only constant initializers for var variables are allowed. To
initialize variables with non-constant values, you need an
initialization function which is called automatically when an object
is being constructed from the class. Such a function is called a
constructor
From: dirk [EMAIL PROTECTED]
can anyone explain to me, why I can't resize an array inside a class?
Sample Code:
?php
class Liste {
var $input = array (1,2,3);
var $input2 = array_pad ($input,10, 1);
}
?
Output:
Parse error: parse error, unexpected '(', expecting ',' or ';' in
Well, doesn't work either:
Parse error: parse error, unexpected T_VARIABLE, expecting T_FUNCTION
in /srv/www/htdocs/stundenplan/stpoo.php on line 5
I forgot to mention that I'm using php-5.0.1 before
Dirk
On Fri, 10 Sep 2004 14:26:22 -0400, John Holmes
[EMAIL PROTECTED] wrote:
From: dirk
From: dirk [EMAIL PROTECTED]
Try this:
var $input = array(1,2,3);
var $input2 = array();
$this-input2 = array_pad($this-input,10,1);
Well, doesn't work either:
Parse error: parse error, unexpected T_VARIABLE, expecting T_FUNCTION
in /srv/www/htdocs/stundenplan/stpoo.php on line 5
The array_pad
Works fine within the constructor, thanks.
Dirk
On Fri, 10 Sep 2004 14:38:45 -0400, John Holmes
[EMAIL PROTECTED] wrote:
From: dirk [EMAIL PROTECTED]
Try this:
var $input = array(1,2,3);
var $input2 = array();
$this-input2 = array_pad($this-input,10,1);
Well, doesn't work either:
On Fri, 10 Sep 2004 14:26:22 -0400, John Holmes
[EMAIL PROTECTED] wrote:
From: dirk [EMAIL PROTECTED]
can anyone explain to me, why I can't resize an array inside a class?
Sample Code:
?php
class Liste {
var $input = array (1,2,3);
var $input2 = array_pad ($input,10, 1);
}
?
Wouter Van Vliet wrote:
On Fri, 10 Sep 2004 14:26:22 -0400, John Holmes
[EMAIL PROTECTED] wrote:
From: dirk [EMAIL PROTECTED]
can anyone explain to me, why I can't resize an array inside a class?
Sample Code:
?php
class Liste {
var $input = array (1,2,3);
var $input2 = array_pad ($input,10, 1);
M. Sokolewicz wrote:
To summarize:
?php
class Liste {
var $input2;
var $input;
function Liste() { /* or, if you're using php5: public function
__construct() { */
$this-input = array(1,2,3);
$this-input2 = array_pad($this-input,10,1);
}
}
The reason being, for this, that
[snip]
I'm reading data. Can I open a connection within a connection and write
data to another $db.$table or do I have to write my data to an array. In
an array, how do I do this?
I've looked at array_push, but don't think this is what I want?
$authors = array();
I'm reading data. Can I open a connection within a connection and write data to
another $db.$table or do I have to write my data to an array. In an array, how do I do
this?
I've looked at array_push, but don't think this is what I want?
$authors = array();
I cannot seem to access elements inside of the array $things in the
code below. All of the errors say Undefined offset: 7 in
/Library/WebServer/Documents/lis/check.php on line 26 I don't see
why...
The code is:
$q = select * from users where email='.$email.' and
password='.$pass.';
From: Nathan Mealey [EMAIL PROTECTED]
I cannot seem to access elements inside of the array $things in the code
below. All of the errors say Undefined offset: 7 in
/Library/WebServer/Documents/lis/check.php on line 26 I don't see why...
The code is:
$q = select * from users where
On Thursday 26 August 2004 02:17, Nathan Mealey wrote:
I cannot seem to access elements inside of the array $things in the
code below. All of the errors say Undefined offset: 7 in
/Library/WebServer/Documents/lis/check.php on line 26 I don't see
why...
The code is:
$q = select *
how many elements are returned by the sql statement?
If you want the 7th item returned in the sql statement would need to
code $things[6]
Just a hunch...
--
Craig Brothers
@utoRevenue
[EMAIL PROTECTED]
(413) 528-8000 x105
On Wed, 2004-08-25 at 14:17, Nathan Mealey wrote:
I cannot seem to
On Wed, 2004-08-25 at 14:17, Nathan Mealey wrote:
I cannot seem to access elements inside of the array $things in the
code below. All of the errors say Undefined offset: 7 in
/Library/WebServer/Documents/lis/check.php on line 26 I don't see
why...
The code is:
$q =
I cannot seem to access elements inside of the array $things in the code
below. All of the errors say Undefined offset: 7 in
/Library/WebServer/Documents/lis/check.php on line 26 I don't see
why...
print_r is your bestest buddy.
$results = mysql_query($q);
if ($results) {
Hi All,
I have a page where I'm collecting answers from a series of questions.
The questions are entered into the array one at a time so I can keep
track of paging.
$arans = array($_POST);
$_SESSION['arans'][$pageid] = $arans;
Then I want to check the sum of the array for scoring
I would simply build the array more specifically, so that it doesnt
include things you dont want.
Jason
On Tue, 27 Jul 2004 16:20:02 -0500, Alex Hogan
[EMAIL PROTECTED] wrote:
Hi All,
I have a page where I'm collecting answers from a series of questions.
The questions are entered into the
Ten separate arrays with an array at 0 that has the data I'm after.
This is where I'm getting stuck. How can I get to the keys that are
either 'mc' or 'truefalse' and sum them?
foreach my man
http://us2.php.net/foreach
foreach ($_SESSION['arans'] as $arans) {
$truefalse +=
I've got a field in my database that contains a single numerical character
(1 or 2 or 3, etc.). I need to load a different background image in
one cell of a table depending upon what the number the field contains.
What's the easy syntax for associating entries in the field (1 or 2 or
3, etc.) with
I've got a field in my database that contains a single numerical character
(1 or 2 or 3, etc.). I need to load a different background image in
one cell of a table depending upon what the number the field contains.
What's the easy syntax for associating entries in the field (1 or 2 or
3, etc.)
You can either hard code the associations, with something like a
swtich statement, or i suppose loop thru one array, adding a key value
pair of the numbers = background images. Or, you could create a
table called Backgrounds, give them an id which you store in the
existing field of your db, and
I've got a field in my database that contains a single numerical character
(1 or 2 or 3, etc.). I need to load a different background image in
one cell of a table depending upon what the number the field contains.
What's the easy syntax for associating entries in the field (1 or 2 or
3,
On Fri, 23 Jul 2004 14:21:42 -0700 (PDT), Matthew Sims wrote:
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif, 3 = bkgrnd-negative.gif);
You got it...
imgBkgrnd = array(1= bkgrnd-default.gif, 2 = bkgrnd-positive.gif,
3 = bkgrnd-negative.gif);
imgNeeded = table['field'];
Robb Kerr wrote:
On Fri, 23 Jul 2004 14:21:42 -0700 (PDT), Matthew Sims wrote:
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif, 3 = bkgrnd-negative.gif);
You got it...
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif, 3 = bkgrnd-negative.gif); imgNeeded
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif, 3 = bkgrnd-negative.gif);
You got it...
imgBkgrnd = array(1= bkgrnd-default.gif, 2 = bkgrnd-positive.gif,
3 = bkgrnd-negative.gif);
imgNeeded = table['field'];
imgName = ???
http://us3.php.net/array
$imgBkgrnd =
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif, 3 = bkgrnd-negative.gif);
You got it...
imgBkgrnd = array(1= bkgrnd-default.gif, 2 =
bkgrnd-positive.gif,
3 = bkgrnd-negative.gif);
imgNeeded = table['field'];
imgName = ???
http://us3.php.net/array
$imgBkgrnd =
I have a class called DBI which handles all of my database calls. One
method called Fetch_Array simply has
return mysql_fetch_assoc($resultID)
It's losing it's value when I try to pass the val to another var
example
class BaseItem
{
function getBaseItems()
{
return
please CC me, as I am on digest.
---
say I've got a class that stores the cookie/get/post vars.
I want to retrieve say one of them.
Say, that post vars come back from browser as:
POST[var1_arr][dim1][dim2]
they are stored in
Hi all
I have this problem whereby im try to create some kind of an array of a
split off a file.
//Here I pull the file in the array $contents.
$contents = file($hotelpathprod.$hotel);
foreach($contents as $arr=$conts){
$ff[] = split(\|,$conts); //Here im trying to
Not sure if the subject was worded correctly, but
I was looking to see if this (or something like it) is possible.
$array = array('key_1' = 'This is some text',
'key_2' = 'b' . $array['key_1'] . '/b'
);
And the array structure would be something
501 - 600 of 1246 matches
Mail list logo