Code: Select all
<td><a href="#" onclick="openWindow('pic.php?image=seashells')"><img src="images/thumbs/seashells.jpg" alt="" border="0" /></a></td>Then I run into a DB problem. Using PhpMyAdmin, I have a mySQL db named "images", with a table called "description" with 2 columns. Then in there, one is a LONGTEXT and the other is a varchar(20). I then add info to it...
Code: Select all
INSERT INTO `description` ( `txtdesc` , `imageID` )
VALUES (
'This is a description. It has useful info in it on the image, so on and so forth.', 'seashells'
);Code: Select all
<?php
$image=$_GET['image'];
$urlToPic="images/thumbs/".$image.".jpg";
$db=mysql_connect("localhost", "root");
mysql_select_db("images", $db) or die(mysql_error());
$sql="SELECT txtdesc, imageID FROM description WHERE imageID='".$image."'";
$result=mysql_query($sql, $db) or die(mysql_error());
while($row=mysql_fetch_assoc($result)){
echo "$row";
}
?>
<table>
<tr>
<td><img src="<?php echo $urlToPic; ?>" alt="" /></td>
<td valign="top">Blurb:
<p> </p></td>
</tr>
</table>With this code, mySQL is returning "Array" as the $row value. Not what I'm after..
Do you see anything or know of a function that I don't where I can return the values I have entered? I thought it was an easy task, but I guess I'm doing something wrong... I have a feeling it is in the set up of the DB.
Thanks.
-S