Re: mssql returned array
| From: | Carroll Barrett | Date: | Mon, 05 Jun 2000 13:58:32 +0000 |
| Subject: | Re: mssql returned array | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-198@lists.php.net to get a copy of this message | ||
Rainer,
At the end of your script, you wrote these 2 lines:
$u=get_cid(35800);
echo $res["TEST"];
Since you returned the value of get_cid() into $u, you should change the
second line to
echo $u["TEST"];
I'm surprised that 'echo $rest["TEST"]' printed anything at all.
HTH.
Carroll Barrett
-----Original Message-----
From: Rainer Zufall <rainer.zufall@gmx.li>
To: php-db@lists.php.net <php-db@lists.php.net>
Date: Sunday, June 04, 2000 6:11 AM
Subject: [PHP-DB] mssql returned array
>
>Please HELP !!!
>I am working with php4, apache and linux.
>I use sybase-11.9.2 to connect to an WNT mssql server.
>Sometimes (<10% of the time ) my get_cid functions returns wrong
values.
>
>function get_cid($cid)
>{
># $fields="FIRSTNAME,..."
> $r=mssql_query("select $fields from masteraccounts where
>CUSTOMERID=$cid");
> $ma=mssql_fetch_array($r);
> mssql_free_result($r);
># do some more querys
>$res=array("a"=>"b");
>$res["TEST"]=$ma["TEST"];
>
>echo $res["TEST"]; # everything is great !!
>return $res;
>};
>
># open db
>
>$u=get_cid(35800);
>echo $res["TEST"];
># prints 'a' , what went wrong ?????
>
># close db
>
>I tried this code with RC1 and the final version
>
>I don't know how to eliminate the problem, please help
>
>
>Markus
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
>For additional commands, e-mail: php-db-help@lists.php.net
>To contact the list administrators, e-mail:
php-list-admin@lists.php.net
>