Re: Updating the SQL key value



bill wrote:

One additional question: does the foreach loop terminate because
the query return false ?

It terminates as soon as the query has run out of rows.

It's a PHP 5 feature called "Iterators" -- that is PDO queries are
returned as objects that, although they are not arrays, can be treated as
arrays in a foreach loop. The solution would work equally well using PHP 4
constructs, but the code doesn't look as neat.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
.



Relevant Pages

  • Re: XML performance extremely slow for no obvious reason
    ... on optimizing XQuery in SQL Server 2005. ... doesn't "have arrays," it sort of does, if you use a string as an array. ... it looks like XML is probably our best bet in this situation. ... I guess it's not XML as such that's the problem, just the query optimizer ...
    (microsoft.public.sqlserver.xml)
  • Re: PHP/MySQL warnings about results
    ... Getting the result arrays is easy, via mysql_fetch_array, and ... when the query in question is an INSERT, ... These queries do not return a result resource. ...
    (comp.lang.php)
  • Constructing a search query
    ... I am doing a compound lookup by deriving person_id values for a query ... I have the id values from the lookup tables in separate arrays. ... each of which has criteria a person may search on ...
    (alt.php)
  • Re: PHP/MySQL warnings about results
    ... Getting the result arrays is easy, via mysql_fetch_array, and ... when the query in question is an INSERT, ... These queries do not return a result resource. ... for UPDATE, DELETE, etc. mysql_query returns TRUE on success and FALSE on error. ...
    (comp.lang.php)
  • Re: XML performance extremely slow for no obvious reason
    ... doesn't "have arrays," it sort of does, if you use a string as an array. ... For an thorough treatment of the subject of arrays and SQL Server, ... it looks like XML is probably our best bet in this situation. ... I guess it's not XML as such that's the problem, just the query optimizer ...
    (microsoft.public.sqlserver.xml)