php-general Digest 13 Jan 2007 12:07:06 -0000 Issue 4567

Topics (messages 247020 through 247024):

Extracting XMP text from Jpeg
        247020 by: Dotan Cohen
        247024 by: zerof

Unbuffered Query
        247021 by: Richard Lynch
        247022 by: Jim Lucas
        247023 by: Roman Neuhauser

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        php-general@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
The birth of my first daughter has inpired me to get the photo gallery
on my site up to date. To do so, I need to extract XMP data from Jpeg
pictures. Here is a test pic:
http://dotancohen.com/gili.jpg
(beware, it's 1.8 MB)

This pic has three tags:
TEST
MILOTTEST
גילי

I can see the tags using linux's strings and grep commands, but how
can I get them into an array in php? I have been playing with the PHP
JPEG Metadata Toolkit but I can't seem to get the XMP tags into an
array and I'm getting frustrated! This is time that I should be with
Meirav (her name), not googling for hours on end. Any advice,
suggestions, and code examples are very, very welcome at this point.
Those who know me from the list know that I never ask for code
examples (not the best way to learn) but I'm really stumped now, and
I've got a little girl to feed / give attention to / take care of the
house because the wife is nursing / study / work. Thanks in advance.

Dotan Cohen

http://lyricslist.com/lyrics/artist_albums/655/fozzy.html
http://what-is-what.com/what_is/spyware.html

--- End Message ---
--- Begin Message ---
Dotan Cohen escreveu:
The birth of my first daughter has inpired me to get the photo gallery
on my site up to date. To do so, I need to extract XMP data from Jpeg
pictures. Here is a test pic:
http://dotancohen.com/gili.jpg
(beware, it's 1.8 MB)

This pic has three tags:
TEST
MILOTTEST
גילי
.................................

http://www.ozhiker.com/electronics/pjmt/library/list_contents.php4?show_fn=XMP.php

--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
----------------------------------------------------------
Você deve, sempre, consultar uma segunda opião!
----------------------------------------------------------      
You must hear, always, one second opinion! In all cases.
----------------------------------------------------------

--- End Message ---
--- Begin Message ---
I have this process that dumps out database records to static HTML pages.

The basic algorithm goes like:

//Set any un-parented item (a root in the thread) to be its own parent:
update entry set original_id = entry_id where original_id is null

//collect any "dirty" entries (changed in db, need to re-publish)
$dirty = select entry_id from entry where dirty = 1

while (list($entry_id) = mysql_fetch_row($dirty)){
  //find the whole thread:
  $followups = select entry_id, X, Y from entry where original_id =
$dirty_id
  //there is an ORDER BY which is not relevant

  //get some thread metadata from the first row's X field
  list($junk, $X) = mysql_fetch_row($followups);
  //$X is the same for all rows...
  echo "<h1>$X</h1>\n";

  //reset to row 0
  mysql_data_seek($followups, 0);
  while (list($entry_id, $X, $Y) = mysql_fetch_row($followups)){
    echo "<p>$Y</p>\n";
  }
}

So, how come *SOMETIMES*, seemingly at random, I get:

Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index
116 (or the
query data is unbuffered) in
/www/acousticdemo.com/web/complaints/publish.cron on
line 26

Line 26 is, obviously, the mysql_data_seek call above...

I do not *THINK* there is any other process anywhere deleting rows
from the table -- it should be an ever-growing table...

So is the query data being unbuffered out from under me due to some
my.cnf setting?...

Or am I just plain wrong, and *something* is deleting from the entry
table?

I Googled for the error message, and found about a 26,000 web sites
that are exhibiting this error, rather than the folks discussing this
error. :-v

The few I was able to weed out were obvious logic errors, which I
don't think I have.

I've read the mysql_unbuffered_query on php.net and think I understand
it in respect to mysql_query et al.

I guess I'm looking for reassurance that it's definitely my mistake
somewhere in the mess I've made, and that I'm looking for a delete
query, and it's not a subtle bug or feature I'm failing to understand.

:-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--- End Message ---
--- Begin Message ---
Richard Lynch wrote:
I have this process that dumps out database records to static HTML pages.

The basic algorithm goes like:

//Set any un-parented item (a root in the thread) to be its own parent:
update entry set original_id = entry_id where original_id is null

in the following you are looking for dirty flagged rows, were they set to dirty before or after your previous statement?
//collect any "dirty" entries (changed in db, need to re-publish)
$dirty = select entry_id from entry where dirty = 1

while (list($entry_id) = mysql_fetch_row($dirty)){
  //find the whole thread:
  $followups = select entry_id, X, Y from entry where original_id =
$dirty_id
are you really meaning to use $dirty_id, or did you mean to use $entry_id??? $dirty_id doesn't exist as far as I can tell. unless it is something that was set before all this.
  //there is an ORDER BY which is not relevant

Personally, I would do some check right here to see if the result set has at least one row at this point and then issue a continue; if mysql_num_rows() returns 0. That way you won't get empty h? tags floating around.
  //get some thread metadata from the first row's X field
  list($junk, $X) = mysql_fetch_row($followups);
  //$X is the same for all rows...
  echo "<h1>$X</h1>\n";
I would check your HTML output for empty <h1></h1> tags, this would tell you that it didn't find anything :(

Hope this helps

Jim Lucas

  //reset to row 0
  mysql_data_seek($followups, 0);
  while (list($entry_id, $X, $Y) = mysql_fetch_row($followups)){
    echo "<p>$Y</p>\n";
  }
}

So, how come *SOMETIMES*, seemingly at random, I get:

Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index
116 (or the
query data is unbuffered) in
/www/acousticdemo.com/web/complaints/publish.cron on
line 26

Line 26 is, obviously, the mysql_data_seek call above...

I do not *THINK* there is any other process anywhere deleting rows
from the table -- it should be an ever-growing table...

So is the query data being unbuffered out from under me due to some
my.cnf setting?...

Or am I just plain wrong, and *something* is deleting from the entry
table?

I Googled for the error message, and found about a 26,000 web sites
that are exhibiting this error, rather than the folks discussing this
error. :-v

The few I was able to weed out were obvious logic errors, which I
don't think I have.

I've read the mysql_unbuffered_query on php.net and think I understand
it in respect to mysql_query et al.

I guess I'm looking for reassurance that it's definitely my mistake
somewhere in the mess I've made, and that I'm looking for a delete
query, and it's not a subtle bug or feature I'm failing to understand.

:-)


--- End Message ---
--- Begin Message ---
# [EMAIL PROTECTED] / 2007-01-12 23:30:15 -0600:
> Warning: mysql_data_seek(): Offset 0 is invalid for MySQL result index
> 116 (or the
> query data is unbuffered) in
> /www/acousticdemo.com/web/complaints/publish.cron on
> line 26
 
http://www.php.net/manual/en/function.mysql-unbuffered-query.php:

    You cannot use mysql_num_rows() and mysql_data_seek() on a result set
    returned from mysql_unbuffered_query().

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

--- End Message ---

Reply via email to