Re: [PHP] Quotes in querys

2009-01-14 Thread Robert Stankiewicz



I am trying to get the following to work:
"Select Netid from Users where Netid = '$_SESSION[phpCAS][user]'"
Netid is a string type.
No matter where of if I put the quotes, I still get array[phpCAS] not the 
value.
  

Maybe try this :

$q = 'Select Netid from Users where Netid = "' . $_SESSION[phpCAS][user] . '"';





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Create $var with some function

2009-01-22 Thread Robert Stankiewicz



function createvar($var) {
${$var} = 'foo';
global ${$var};
//or global $$var, i don't know it yet.
}
  

This should work.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extract code from XML

2009-01-30 Thread Robert Stankiewicz


check this :
http://nl3.php.net/manual/en/book.simplexml.php


best regards
Robert


Angelo Zanetti :


 

 




Hi all,

I have the following snippet of XML:

Code:

  

  HasPictures="true">


Code="AME">


I need to get the Code for the item, IE get the value "AME" from the 
XML. I am using PHP5 and the following code which I can extract the 
value of the Item: "AMERICAN".


PHP Code:

 $hotelElements = $xpath->query( 'HotelDetails/Hotel', 
$searchHotelPriceReponseElement );


foreach( $hotelElements as $hotelElement ) {

$item = $xpath->query( 'Item' , $hotelElement );

I know you can use an @ sign but I am not 100% sure.

Thanks in advance.

Kind regards,
Angelo Zanetti
Application Developer



**Telephone:** +27 (021) 552 9799
**Mobile:**   +27 (0) 72 441 3355
**Fax:**+27 (0) 86 681 5885
*
**Web:*** http://www.elemental.co.za
**E-Mail:** ang...@elemental.co.za 

 




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] irrational behavior

2009-05-12 Thread Robert Stankiewicz

Maybe, because of this ?

$category[$row['name']] = $row;
  

.

$cat = $category[$ii]['name']; //===this is line 36==



best regards
Robert

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php