close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

img src displaying

Thread began 12/05/2018 6:42 am by birdscreen398247 | Last modified 12/05/2018 1:00 pm by Ray Borduin | 632 views | 3 replies |

birdscreen398247

img src displaying

I am trying to display an image in a table. The name of the image is stored in a table. I used MySQLIRecordset to create the recordset and a Mysqli connection.

I have the following code:
<?php require_once('../connections/siteguide2018.php'); ?>
<?php require_once('../webassist/mysqli/rsobj.php'); ?>
<?php
$rsCountyMap = new WA_MySQLi_RS("rsCountyMap",$siteguide2018,1);
$rsCountyMap->setQuery("SELECT * FROM counties WHERE CountyID = ?");
$rsCountyMap->bindParam("i", "".(isset($_GET['CountyID'])?$_GET['CountyID']:"") ."", "-1"); //colname
$rsCountyMap->execute();
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
<table width="800" border="1" cellspacing="4" cellpadding="4">
<tr>
<td><img src="https://pabirds.org/siteguide/maps/county/<?php echo($rsCountyMap->getColumnVal('MapFileName')); ?>" alt="" name="CountyMap" width="400" id="CountyMap" /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php echo($rsCountyMap->getColumnVal("MapFileName")); ?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</body>
</html>

The MapFileName name displays correctly in the second row of the table, so I know the table data is being correctly retrieved, but the related image does not display in the first row.

I tried changing the path to the image (../maps/county/ and /maps/county/). The full https: path works on other (older pages) on my site.

What am I missing?

Sign in to reply to this post

Ray BorduinWebAssist

You may have to use:
<?php echo($rsCountyMap->getColumnVal('MapFileName',false)); ?> in the image src.

If you give me a url where I can see the problem I could be more confident in my answer.

Sign in to reply to this post
Did this help? Tips are appreciated...

birdscreen398247

That didn't work.

If you go to: https://pabirds.org/siteguide/PAStatePage.php

Click on Adams (the first county on the list) and it will pass the variable to the page in question. Note that this is a preliminary page, just working out the procedures before finalizing the look and feel. There are other items on the page that I have not yet worked on, so ignore those error messages.

As you can see, the Site List in the upper right is a repeat region that is working fine (in response to my other post - thanks) and other pieces of information from tables are displayed. Just the img doesn't.

Frank

Sign in to reply to this post

Ray BorduinWebAssist

The path to the image it is adding to the page is:

https://pabirds.org/siteguide/maps/county/Adams.gif

which isn't correct (you can see by pasting it into your browser).... what is the correct full path to the image?

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...