Im using a <h3> and <p> tags of an accordian to list enteries like shown below.
All entries under the <h3> must be in the <p> tags for the section
<h3>A</h3>
<p>Abe<br />
Apple<br />
</p>
my code is
<h3>A</h3>
<p><?php get_video(a); ?></p>
i want any videos beginning with the letter a to appear hear in a link
if there are videos in the database then i want them shown else a message saying sorry no videos added yet.
e.g.1: <p><a href=“video.html?id=1”>Abe Video</a><br />
<a href=“video.html?id=2”>Apple Video</a><br /></p>
e.g.2: <p>Sorry no videos are added yet</p>
i cannot get the no videos message to appear. i dont know how to get it to show that there is no video in the db
MY PHP BELOW
function get_video($letter){
$sql = "SELECT * FROM amc_videos ";
$sql .= "WHERE title LIKE ‘$letter%’ AND hide = 0 ";
$sql .= “ORDER BY title ASC”;
$result = mysql_query($sql);
if(!$result){
$op = "<p>Error with query " . mysql_error() . “</p>”;
}else{
while($video = mysql_fetch_array($result)){
$id = $video[‘id’];
$title = $video[‘title’];
$op = “~ <a href=\“videos.html?id=$id\”>$title</a><br />”;
}
echo $op;
}
}