PHP+MySQL=Help(?)

From: Date: Tue, 30 Oct 2001 18:13:51 +0000
Subject: PHP+MySQL=Help(?)
Groups: php.general 
Request: Send a blank email to php-general+get-72907@lists.php.net to get a copy of this message
I am trying to pass a variable to a popup window, to do a search in a database, and display an image based on the results... Here is what I have messed up so far (this is the 1st time I have used php/mysql.... no userID/Pswd on local host) The script that passes the variable (variable does pass to 2nd html doc) <script language="Javascript"><!-- function popImg1() { window.open('../../assets/img760/img.php?getimg=alfstag1','img','toolbar=0,l ocation=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=0,copyhist ory=0,width=800,height=600,left=0,top=0') //--> </script> The php/mysql connect & search (have tested the connect and it works db name=img760 table=img) <? $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"; $imglocation = 'imglocation'; $height = 'height'; $width = 'width'; ?> The display of the image <td align="center"><a href="javascript:void(0)" <img src="<? echo $imglocation ?>" width="<? echo $width ?>" height="<? echo $height ?>" border="0"></a></td> I have been able to pass these variables directly in the url and display the image..... trying to do it with a DB look up all I get in the code is the literal not the variable (<img scr=imglocation width=width....etc) ... Where am I going wrong? I have fiddled and changed until I have about exhausted the possibilities... (Apache server on Win2k if it makes any difference.... should not...) What is a good reference book on PHP/MySQL... ??? I have one but obviously it was a bad choice (title/author to remain unspoken..... forever) Thanks Mike

« previous php.general (#72907) next »