Jump to content
php.lv forumi

mysql select problema


FT3

Recommended Posts

Sveiki.

 

Man te tada lieta, man datubaze ir izveidotas 3 kategorijas un 3 forumi , bet izvada tikai vienu ! why ?

 

<?
include('connect.php');
$result = mysql_query("SELECT * FROM `rc_forum_category` ORDER BY `id` ", $connect) or die(mysql_error());
 if(mysql_num_rows($result) == 0){echo 'forum DOWN !';}
 for ($i = 0; $i < mysql_num_rows($result); $i++)
 {
 	$c_id = mysql_result($result, $i, "id");
 	$c_title = mysql_result($result, $i, "title");

$result = mysql_query("SELECT * FROM `rc_forum_forum` WHERE `category` = '$c_id'", $connect) or die(mysql_error());
 for ($i = 0; $i < mysql_num_rows($result); $i++)
 {
 	$f_id = mysql_result($result, $i, "id");
 	$f_title = mysql_result($result, $i, "title");  

echo '
<b>'.$c_title.'</b><BR>
'.$f_title.'
';
}
}
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...