So I have a script that retrieves an image from a sql table and displays it.
I can call the script inside a html using something like this:
<img src="display01.php"/>
Now I have another script called "text01.php" that fetches text from the sql table and the script works 100%; what I need is how to call that script inside the html.
Here is the code:
<html>
<body>
....
....
<div class="nice">
<div style="position:absolute; top:50px; left:60px;">
<img src="display01.php"/>
</div>
<div style="position:absolute; top: 100px; left: 400px;">
<!--text01.php should go here-->
</div>
</div>
</body>
</html>
text01.php:
<?php
//variables that will be needed to connect to mysql
$host="localhost";
$username="root";
$password="quatre";
$database="binary";
//make connection to mysql
//and store connection in the variale $con
$con=mysql_connect($host,$username,$password);
//die if it didn't connect
if(!$con)
{
die('Could not connect'. mysqlerror());
}
//if connected
//select database to use
mysql_select_db($database);
//store query in variable $query
$query="SELECT description from tbl_images where id=1";
$results=mysql_query($query,$con);
$row = mysql_fetch_array($results);
echo $row['description'];
?>
How can I call the second script?