Actually, 

        "xupdate .../asd/asd[$index]"

 and 
        "xupdate .../asd/asd[" . $index ."]"

are equivalent.  $var is not exclusively for echo/print statements.  For
example, $array[$key] is valid, as is $db->query("SELECT * FROM table
WHERE id=$id") or even $var = "value of $foo".

Further, the plus (+) symbol in PHP is exclusively for math.  Your
string below,

> $query = "<xupad ....... /asdasd/asdasd["+$index+"]";

makes $query == 0, not a string.  Really, go try it.  echo $query and see for 
yourself.

So in closing, before flaming someone who is asking a valid question, make sure 
that
you indeed have a clue.


J.


On Wed, 2003-08-13 at 15:53, onno wrote:
> No offence but seems like you don't have much clue about what php does...
> 
> the $var works in echo/print statements ONLY - for the rest it is just a
> dollar sign - why on earth would Xupdate keep track of PHP stuff???????
> 
> A normal fix:
> 
> in php
> 
> $query = "<xupad ....... /asdasd/asdasd["+$index+"]";
> 
> //call xindice with $query string.
> 
> so simple i seriously doubt if you have any clue what you are doing with
> programming
> 
> 
> 
> ----- Original Message -----
> From: "Shane Dempsey" <[EMAIL PROTECTED]>
> To: <[email protected]>
> Sent: Wednesday, August 13, 2003 7:35 PM
> Subject: XUpdate - delete a node using dynamic vars
> 
> 
> > Hi,
> >
> >     This task has been driving me crazy for months. I want to delete nodes
> > based on user input. The usual example I have seen is the static
> > <xupdate:remove select="/addresses/address[1]"/> which is great if I want
> to
> > delete node 1 or 2 or 3 etc. but most real world applications require the
> > dynamic deletion of nodes. I am using php  and tried <xupdate:remove
> > select="/addresses/address[$index]"/> and every concievable variation. I
> > have also tried using the <xupdate:variable name=index select="...">
> >
> >    Is there a way to get xupdate to work with dynamic variables in the
> > select query or if not is there another way of deleting nodes using
> dynamic
> > queries.
> >
> >
> > Regards
> > Shane Dempsey
> >
> > Software Development Engineer
> > Claddagh Resources
> > Links Business Centre
> > Lisfannon
> > Co. Donegal
> > Tel: +353 77 20400 (direct: 20402) (ext:202)
> > Fax: +353 77 20401
> > email: [EMAIL PROTECTED]
> >
> >
-- 
Jason A.H. Mroz    ([EMAIL PROTECTED])
  Software Developer
  Client Support and Application Development
  Communications Research Centre Canada
  Voice: (613) 991-4524   Fax: (613) 991-5795
  http://www.crc.ca/


Reply via email to