"Kurt Lieber"
>
> You would use a while loop if/when you have multiple records to retrive.
> From your original code example, it seemed as though you would only have
one
> record.  (though, for safety's sake, you should code a LIMIT into your sql
> statement)
>

Yes I only need one image location with height and width from the db file


>
> > This may be the problem as I now get "supplied argument not valid mysql
> > result" on this line.
> > $query = "select imglocation,height,width from img where
> > imgname='$getimg'";
>
> Two things to try:
>
> 1.  Run that exact query on a mysql command line, substituting whatever
> variable name you're trying to pass in the URL.  Often times, I find that
I
> tihnk I have a PHP problem when, in fact, I screwed up my query syntax
> somewhere.
>


Doing a command line query at a mysql prompt brings back the correct data
select imglocation,height,width from img where imgname='alfstag1'
returns:
./alf_760stag1.jpg (the image location)
544 (the height)
760 (the width)

> 2.  Explicitly define $getimg as something you know to be a valid image.
If
> that works, then you know it isn't getting passed from the url properly.
>
> > It looks like I might be able to use the GetImageSize function to do
this
> > same thing?  maybe?  All I am doing is getting the location (url) of an
> > image and its height and width for an <img src= > statement.....  maybe
I
> > am making this into a bigger job than necessary??  I think I have been
> > working on it too long today and I need a long walk.....
>
> Actually, yes you can.
>
> $myImgSize = getImageSize('/unix/path/to/my/file.jpg'); should return the
> image sizes in an array.  You should then be able to do something like:
>
> <img src="file.jpg" $myImgSize[3]>
>
> Which should automatically include height/width parameters.  (see this
> function on the php site for more info -- also, that's untested,
off-the-cuff
> code I just wrote.  Might not work perfectly. :)
>
> --kurt

I found the GetImageSize while digging around the manual and tried to work
it in without success.  I have so far this evening re-written this with
separate mysql_connect, mysql_select_db, and mysql_query functions and
tested after each and that is as far as I can get without errors.  I have
tried mysql_fetch_array, mysql_fetch_object, and mysql_fetch_row...  all
have failed for some reason  I am testing with an if (variable) set message
then echo each message in the body...  Here is a URL of a page where I pass
the same variables manually and use them in the popup to give you an idea of
what I am trying do to with a database holding this info
http://www.bronze-gallery.com/French_Sculptors/Alfred_Barye/Stag_Scratching/
stag_scratching.html click on either image to get to the php popup this
declares and passes the 3 variables in the url.

so far the light bulb has not clicked on..... The php4 book you recommended
is on order....

Mike





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to