https://antibiotiqueaugmentin.com/surdosage-augmentin-bebe/
× Welcome to the ToolsJX forum!


Show Image In Table?

  • hominid4
  • hominid4's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 8 months ago #2383

Hi. I have a database table called "partners_technology", with the fields: Logo, Company, Country, Expertise. This table is continually added to and logo data is in the format of: /images/partners/technology/logo.png

We need it to show the logo instead of the image path, so I created a view:
CREATE VIEW partners_technology_logo AS
SELECT Logo, CONCAT('<img src="', Logo, '" />') AS image
FROM partners_technology

That created the second table of just the fields: Logo and image; and the "image" data looks correct.

I'm needing to select the "partners_technology" table within the "Table Settings" since that is where all our data is. How can I have it pull the "image" data instead of the Logo data?

Here is a test I'm doing:
www.nomagic.com/partnertest

Thank you!

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #2385

Hi,

Select all data in the view and than use the view to display it on page.

CREATE VIEW v_partners_technology AS
SELECT *, CONCAT('<img src="', Logo, '" />') AS image
FROM partners_technology

The following user(s) said Thank You: hominid4

Please Log in or Create an account to join the conversation.

  • hominid4
  • hominid4's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 8 months ago #2387

Ha, that was easy! :)

Thank you!

Please Log in or Create an account to join the conversation.

Moderators: tomaz
Time to create page: 0.155 seconds

Contact Us

Contact us on Discord

Contact us on Facebook