All will have title tags, some will contain urls as well.
I constructed a two column table called cms_pics, with the columns: id, titletag.
Id is simply an auto increment number, title tag is the code for the image eg
Code: Select all
<img src="uploads/images/{$num}.jpg" alt="Australia" title="Australia" />
I tried to follow online tutorials but am totally lost. My UDT will accept the code below as valid, but displays nothing.
What I am trying to arrive at is an output string something like this:
Code: Select all
<img src="uploads/images/25.jpg" alt="Bicycle on Road" title="Riding the Great Ocean Road" />
Code: Select all
mysql_connect("localhost","user","password");
mysql_select_db("mydatabase");
$result = mysql_query("SELECT * FROM cms_pics WHERE id = '1' "); //id = $num
while($rows = mysql_fetch_assoc($result)){
echo $rows[$titletag];
}
Any help would be great