Swapping text for image

I have a database and in one field i have a varchar with the text in there "Physical’.

how do i change this into an image that is on my computer so when goto the localhost webpage it shows the image instead of the text.

https://www.php.net/manual/en/function.imagettftext.php

https://www.php.net/manual/en/function.imagestring.php

Thank you

I forgot to mention i am using phpmyadmin

I misunderstood your question. If I understand correctly, you want to store the path to the image in the DB.

So I have a field at the moment called Media and the entry is ‘Physical’ I want to change this to a floppy disk image can this be done, so when I get php to show it on the website. and no it will be on my local drive

UPDATE yourtable
   SET Media = 'file://A:kitty.jpg'
 WHERE Media = 'Physical'

Here is my code, where can i put the above

<?php

		$sql = "SELECT
	ID,
	GAME,
	YEAR,
	PLATFORM,
	PUBLISHER,
	Owned,
	COMPLETED,
	Media,
	Launcher

FROM
	games;";


		$dt = "SELECT Convert(VARCHAR(3, started, 101))";

		$result = mysqli_query($conn, $sql) or die("Bad Query: $sql");
		$num_rows = mysqli_num_rows($result);?>


    <?php while ($row = mysqli_fetch_assoc($result)):
     ?>```

I have some code that changes the output of my database within php.

This code changes the entry ‘1’ to a :heavy_check_mark:.

IF
	( owned = 1, '✔', 'X' ) AS owned,
	IF
		( completed = 1, '✔', ' ' ) AS completed

How do i do this with an image?

easy, just replace '✔' in the above code with the image url, and make sure php recognizes it

1 Like

Thank you got it to work