in the following code i am trying to display the each category name in the table as a link to cat.html [code=php]
<html>
<head>
</head>
<body>
<?php
$str1="<a href=cat.html>" ;
$str2="<//a>";
$user_name="roo t";
$password="";
$database="myfo rum";
$server="localh ost";
$db_handle=mysq l_connect($serv er,$user_name,$ password);
$db_found=mysql _select_db($dat abase,$db_handl e);
if($db_found)
{
echo "Forum database found"."<BR>";
$SQL="select * from categories";
$result=mysql_q uery($SQL);
while($db_field =mysql_fetch_as soc($result))
{
print $db_field['id']."<BR>";
$str1.$db_field['name'].$str2;
//print $db_field['name']."<BR>";
print $db_field['topics']."<BR>";
}
}
else
{
echo "Forum database not found";
}
mysql_close($db _handle);
?>
</body>[/code]however it only shows :
Forum database found
1
0
(only one row in database)
can someone please help me as to why isnt it showing the category name as a link ?
<html>
<head>
</head>
<body>
<?php
$str1="<a href=cat.html>" ;
$str2="<//a>";
$user_name="roo t";
$password="";
$database="myfo rum";
$server="localh ost";
$db_handle=mysq l_connect($serv er,$user_name,$ password);
$db_found=mysql _select_db($dat abase,$db_handl e);
if($db_found)
{
echo "Forum database found"."<BR>";
$SQL="select * from categories";
$result=mysql_q uery($SQL);
while($db_field =mysql_fetch_as soc($result))
{
print $db_field['id']."<BR>";
$str1.$db_field['name'].$str2;
//print $db_field['name']."<BR>";
print $db_field['topics']."<BR>";
}
}
else
{
echo "Forum database not found";
}
mysql_close($db _handle);
?>
</body>[/code]however it only shows :
Forum database found
1
0
(only one row in database)
can someone please help me as to why isnt it showing the category name as a link ?
Comment