我创建了 html 表单,当我单击提交按钮时,我从数据库中获取记录,但如果数据不在数据库中,则打印
http://bukkyolu.com/mp3/upload/
这不是来自数据库,它只是我在下面的语句中打印的静态值
http://bukkyolu.com/mp3/upload/".$row['2']."'> ,
if the .$row['2'].is not in to database
我想要空白空间而不是打印的默认链接
<?php
$category=$_POST["category"];
$month=$_POST["month"];
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "bukkyolu_mp3";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
$query = "SELECT title,Amp3,Bmp3,Cmp3 FROM mp3_data WHERE`category` = '$category' and `month` = '$month' ";
$result1 = mysql_query($query);
$row = mysql_fetch_array($result1);
//echo $row['s_id'];
echo "<table border='1' align='center' >";
while ($row = mysql_fetch_row($result1)){
// echo "<td><a href='#' onclick='someFunction()'>" .$row['0']. "</a> </td>";
echo "<tr><th>Title:</th><td>".$row['0']."</td></tr>";
echo "<tr><th>African:</th><td><a href 'http://bukkyolu.com/mp3/upload/".$row['1']."'>http://bukkyolu.com/mp3/upload/".$row['0']."</a></td></tr>";
echo "<tr><th>British:</th><td><a href 'http://bukkyolu.com/mp3/upload/".$row['2']."'>http://bukkyolu.com/mp3/upload/".$row['0']."</a></td></tr>";
echo "<tr><th>Caribbean:</th><td><a href 'http://bukkyolu.com/mp3/upload/".$row['3']."'>http://bukkyolu.com/mp3/upload/".$row['3']."</a></td></tr>";
echo "<tr></tr>";
echo "<tr></tr>";
}
echo "</table>";
?>