close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Undefined variable

Thread began 12/03/2018 3:57 pm by john70964 | Last modified 12/12/2018 4:22 pm by Ray Borduin | 196 views | 15 replies |

john70964

Undefined variable

I am trying to get an image to show on the third line but am getting an error in Inspect Element of
<img src="BoatImages/<br />
<b>Notice</b>: Undefined variable: row_Recordset1 in <b>C:\xampp\htdocs\newDatabridge\test.php</b> on line <b>33</b><br />
">
?>
<td width="133"><?php echo($Recordset1->getColumnVal("RecNo")); ?></td>
<td width="178"><?php echo($Recordset1->getColumnVal("Manufacturer")); ?> </td>
** <td width="200"><img src="BoatImages/<?php echo $row_Recordset1['image1_250']; ?>"></td> **

<?php

Can anyone see where I am going wrong please, Undefined variable?

Thanks

John

Sign in to reply to this post

Ray BorduinWebAssist

This needs to be updated to MySQLi, so it should be:

php:
<td width="200"><img  src="BoatImages/<?php echo($Recordset1->getColumnVal("image1_250")); ?>"></td>
Sign in to reply to this post

john70964

Thanks Ray
The error has gone but the image shows as a square missing image.

The record details show but not the boat image.
I have checked the correct DB and table are used and have contents in the correct fields.
I also have checked the directory BoatImages/ has the correct image
which it has.
Looking at page source it shows <img src="BoatImages/"></td>
If I open Inspect Element I see the same but if I right click on the image and view image
I see
Index of /newDatabridge/BoatImages
[ICO] Name Last modified Size Description
[PARENTDIR] Parent Directory -
[DIR] _notes/ 2018-12-03 20:52 -
[IMG] cai3351.jpg 2018-12-03 20:24 18K
Apache/2.4.29 (Win32) OpenSSL/1.0.2l PHP/5.6.32 Server at localhost Port 80

If I click on the image [IMG] cai3351.jpg the correct image appears.
I hope this is clear and you can make sense of all this!

Sign in to reply to this post

Ray BorduinWebAssist

It sounds like the column name is wrong in the code. Is that the correct image column name in your database? Try writing the image name to the page somewhere to make sure you can get the value.

Sign in to reply to this post

john70964

Re: Try writing the image name to the page

How to do this for
boatimages/Image1_250/cai3351.jpg ?

Thanks
John

Sign in to reply to this post

Ray BorduinWebAssist

Add this to the page:

php:
<?php

var_dump
($Recordset1->Results);
?>


Then you can verify that the column name: "image1_250" is correct and that the image is saved in the database.

Sign in to reply to this post

john70964

array(1) { [0]=> array(4) { ["RecNo"]=> int(11742) ["Manufacturer"]=> string(13) "Conyplex N.V." ["Model"]=> string(10) "Contest 29" ["Image1_250"]=> string(11) "cai3351.jpg" } }
11742 Conyplex N.V.
Ray this was the result with a little greyed out image shape.
I have checked the database fields, they all seem OK.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like it should be:


php:
<td width="200"><img  src="boatimages/Image1_250/<?php echo($Recordset1->getColumnVal("image1_250")); ?>"></td>
Sign in to reply to this post

john70964

Hello Ray
Perhaps it may help
I have placed some files for this.
The url in in the PM it may help

Sign in to reply to this post

Ray BorduinWebAssist

The current error is saying that you haven't uploaded the file: Connections/conn1_i.php.

I'm pretty sure the the image display issue is just a bad path to the image. Maybe the wrong folder name or case sensitivity.

If you give me FTP access I can take a look at your directory structure and figure it out.

Sign in to reply to this post
loading

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