.
It is starting to make sense.  I see the correlation between the manual
example and the code you show.  Surprisingly (and equally confusing) the
book I have also uses a while loop with mysql_fetch_array to display a list.

The &getimg variable comes in from the javasript function on the other page
embedded in the url:
window.open('../../assets/img760/img.php?getimg=alfstag1')
the variable content is the field (imgname) that I use to find the record.

I have been passing all of the variables manually via the url but it would
be best if I used a database as there are around 400 to show and changes in
a db are easier than in the html head.

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'";

Thank you for taking the time with me on this.  I will see if I can find the
remaining problems and get to coding the 400+ pages that I need to get this
into.

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.....

Anyway, thank you again for taking the time and for the book recommendation.

Mike


"Kurt Lieber" <[EMAIL PROTECTED]> wrote in message
E15yfMr-0003fP-00@z8">news:E15yfMr-0003fP-00@z8...
> On Tuesday 30 October 2001 11:58 am, turtle wrote:
> > No reading that section of the manual did me no good.  I do not
understand
> > other than I cannot store the results as a variable.
>
> yes, you can.
>
>
> > Is there any of what I have done that is usable?
>
> yes, there is. see below.  It's probably not solid enough to cut 'n'
paste,
> but it at least shows you how to get return results from mysql.
>
> > A recommendation for a book that covers this would be helpful...  the
> > manual on this area is way to abbreviated for someone who has only used
PHP
> > for 2 weeks.
>
> "Beginning PHP4" by Wrox
>
>
>
> <?
>  $link = mysql_connect('localhost')or die ("Could not connect");
>  mysql_select_db('img760')or die ("Could not select database");
>  $query = "select imglocation,height,width from img where
>   imgname=$getimg"; //****you haven't defined $getimg anywhere that I can
see
> // also need to enclose it in quotes: '$getimg'
>   $results = mysql_fetch_array($query); //new line
>  $imglocation = $reults['imglocation'];
>  $height = $results['height'];
>  $width = $results['width'];
> ?>



-- 
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