Subarray

This is a discussion on Subarray within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi, the following scenario: $lang = $_SESSION['lang']; $sql = "SELECT name, $lang FROM table_lang"; $result = mssql_query($sql); while(list($...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-02-2004
Christian Weber
 
Posts: n/a
Default Subarray

Hi,
the following scenario:

$lang = $_SESSION['lang'];
$sql = "SELECT name, $lang FROM table_lang";
$result = mssql_query($sql);
while(list($name, $val) = mssql_fetch_row($result)) {
$common[$name] = $val;
}

This works in Windows2000 and IIS5, but not in Windows Server 2003 and IIS6.

Has anyone an idea??

greets

chris


Reply With Quote
  #2 (permalink)  
Old 08-02-2004
容d Eye Media - Richard Grove
 
Posts: n/a
Default Re: Subarray


"Christian Weber" <avbc.def@ghi.de> wrote in message
news:ceks74$bh7$1@papyrus.erlm.siemens.de...
> Hi,
> the following scenario:
>
> $lang = $_SESSION['lang'];
> $sql = "SELECT name, $lang FROM table_lang";
> $result = mssql_query($sql);
> while(list($name, $val) = mssql_fetch_row($result)) {
> $common[$name] = $val;
> }
>
> This works in Windows2000 and IIS5, but not in Windows Server 2003 and

IIS6.
>
> Has anyone an idea??
>
> greets
>
> chris
>
>


try echoing $lang and see if it is a session thing.
If it is, you may need to edit your php.ini file.
Compare session info in php.ini between the 2 setup's
RG



Reply With Quote
  #3 (permalink)  
Old 08-02-2004
Christian Weber
 
Posts: n/a
Default Re: Subarray

Hello,
all defined vars are available, i have checked.

The vars "$name" and "$val" are present with their values,
but "$common[$name] = $val" does not work in Windows Server 2003, but it
works in Windows2000.

greets chris

"容d Eye Media - Richard Grove" <info崁edeyemedia.co.uk> wrote in message
news:410df81f$0$41791$65c69314@mercury.nildram.net ...
>
> "Christian Weber" <avbc.def@ghi.de> wrote in message
> news:ceks74$bh7$1@papyrus.erlm.siemens.de...
> > Hi,
> > the following scenario:
> >
> > $lang = $_SESSION['lang'];
> > $sql = "SELECT name, $lang FROM table_lang";
> > $result = mssql_query($sql);
> > while(list($name, $val) = mssql_fetch_row($result)) {
> > $common[$name] = $val;
> > }
> >
> > This works in Windows2000 and IIS5, but not in Windows Server 2003 and

> IIS6.
> >
> > Has anyone an idea??
> >
> > greets
> >
> > chris
> >
> >

>
> try echoing $lang and see if it is a session thing.
> If it is, you may need to edit your php.ini file.
> Compare session info in php.ini between the 2 setup's
> RG
>
>
>



Reply With Quote
  #4 (permalink)  
Old 08-02-2004
容d Eye Media - Richard Grove
 
Posts: n/a
Default Re: Subarray


"Christian Weber" <avbc.def@ghi.de> wrote in message
news:cekuqv$fo5$1@papyrus.erlm.siemens.de...
> Hello,
> all defined vars are available, i have checked.
>
> The vars "$name" and "$val" are present with their values,
> but "$common[$name] = $val" does not work in Windows Server 2003, but it
> works in Windows2000.
>
> greets chris
>
> "容d Eye Media - Richard Grove" <info崁edeyemedia.co.uk> wrote in message
> news:410df81f$0$41791$65c69314@mercury.nildram.net ...
> >
> > "Christian Weber" <avbc.def@ghi.de> wrote in message
> > news:ceks74$bh7$1@papyrus.erlm.siemens.de...
> > > Hi,
> > > the following scenario:
> > >
> > > $lang = $_SESSION['lang'];
> > > $sql = "SELECT name, $lang FROM table_lang";
> > > $result = mssql_query($sql);
> > > while(list($name, $val) = mssql_fetch_row($result)) {
> > > $common[$name] = $val;
> > > }
> > >
> > > This works in Windows2000 and IIS5, but not in Windows Server 2003 and

> > IIS6.
> > >
> > > Has anyone an idea??
> > >
> > > greets
> > >
> > > chris
> > >
> > >

> >
> > try echoing $lang and see if it is a session thing.
> > If it is, you may need to edit your php.ini file.
> > Compare session info in php.ini between the 2 setup's
> > RG
> >
> >
> >

>
>



I can't see $common[$name] mentioned anywhere is your script.
Why would this be available?
RG



Reply With Quote
  #5 (permalink)  
Old 08-02-2004
Christian Weber
 
Posts: n/a
Default Re: Subarray

Hi,
the line "$common[$name] = $val;" within the while loop works in
Windows2000.

I can locate entries in the array like $common["string"].


greets
chris


> > > > $lang = $_SESSION['lang'];
> > > > $sql = "SELECT name, $lang FROM table_lang";
> > > > $result = mssql_query($sql);
> > > > while(list($name, $val) = mssql_fetch_row($result)) {
> > > > $common[$name] = $val;
> > > > }
> > > >

> >
> >

>
>
> I can't see $common[$name] mentioned anywhere is your script.
> Why would this be available?
> RG
>
>
>



Reply With Quote
  #6 (permalink)  
Old 08-02-2004
eclipsboi
 
Posts: n/a
Default Re: Subarray

On Mon, 2 Aug 2004 10:43:10 +0200, "Christian Weber" <avbc.def@ghi.de>
wrote:

>Hello,
>all defined vars are available, i have checked.
>
>The vars "$name" and "$val" are present with their values,
>but "$common[$name] = $val" does not work in Windows Server 2003, but it
>works in Windows2000.
>
>greets chris
>

<snip>
>> > while(list($name, $val) = mssql_fetch_row($result)) {
>> > $common[$name] = $val;
>> > }

<snip>

Ah, good ol'M$ and their, "If it ain't broke, break it," philosophy.
Just kidding. ;)

Anyways, seriously now, try this (little bit) longer solution:

while ($row = mysql_fetch_row($result)) {
$results = $row;
}

foreach ($results as $name => $val) {
$common[$name] = $val;
}

Hope this helps. I have no other idea, as I don't use IIS.
Reply With Quote
  #7 (permalink)  
Old 08-03-2004
Christian Weber
 
Posts: n/a
Default Re: Subarray

Hello,
thanks for your reply!
This solution does also NOT work...:-(

greets

chris

> Ah, good ol'M$ and their, "If it ain't broke, break it," philosophy.
> Just kidding. ;)
>
> Anyways, seriously now, try this (little bit) longer solution:
>
> while ($row = mysql_fetch_row($result)) {
> $results = $row;
> }
>
> foreach ($results as $name => $val) {
> $common[$name] = $val;
> }
>
> Hope this helps. I have no other idea, as I don't use IIS.



Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:30 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0