<h2>Members Page</h2>
Your channels:<p />
<?php
$channel_check = mysqls_query("SELECT channel_name FROM channels WHERE created_by='$user'");
$numrows_cc = mysql_num_rows($channel_check);
if ($numrows_cc == 0) {
echo ''; // They don't have any channels so they need to create one
?>
You haven't made any channels yet, click the button to make one.
<form action='create_channel.php'>
<input type='submit' name='goto_channel_create' value='Create my Channel' />
</form>
<?php
}
else
{
while($row = mysql_fetch_assoc($channel_check)) {
$channel_name = $row['channel_name'];
echo "<b>$channel_name</b> - <a href='channel.php?c=$channel_name'>View Channel</a> | <a href='channel_settings.php?c=$channel_name'>Channel Settings</a><p />";
}
echo "$numrows_cc/5 Channels Created";
}
?>
Hello Guys,今天我正在创建一个像Youtube这样的网站,我正在编码我的Members.php页面,我发现这段代码不起作用,有人可以说出了什么遗漏或错误,所以我发现了这个问题。它不会弹出会员频道所以,你能找出错误的代码!
答案 0 :(得分:1)
$channel_check = mysqls_query("SELECT channel_name FROM channels WHERE created_by='$user'");
在第4行中,您使用了mysqls
,其拼写错误。您需要将其更改为mysql
。