dourong6054 2013-08-31 19:54
浏览 38

注意:未定义的索引:topic_creator in

How do i fix Notice: Undefined index: topic_creator in C:\wamp\www\forum\view_category.php on line 313 Im getting two off this errors. I did read on a page that putting @ infront of $topic_creator may help, but i dident. I cant find a place that says how to fix it, so please help me. Here is my code

include_once("connect.php");
$sql = "SELECT id FROM categories WHERE id='".$cid."' LIMIT 1";
$res = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($res) == 1) {
    $sql2 = "SELECT * FROM topics WHERE category_id='".$cid."' ORDER BY topic_reply_date DESC";
    $res2 = mysql_query($sql2) or die(mysql_error());
    if (mysql_num_rows($res2) > 0) {
    while ($row = mysql_fetch_assoc($res)) {

    **Line 313** if($row['topic_last_user']== "") { $last_user = getusername($row['topic_creator']); } else { $last_user = getusername($row['topic_creator']); }

        $topics .="
        <li class='category'><div class='left_cat'>
        <a class='underline' href='view_topic.php?cid=".$cid."&tid=".$tid."'>
        <div class='title'><i class='icon-comment'></i>&nbsp;".$title."</div></a>
        <div class='info'><i class='icon-comments icon-1'></i>&nbsp;".topicreplies($cid, $tid)." Comments&nbsp; &nbsp; &nbsp;<i class='icon-user icon-1'>
        &nbsp;</i>".$last2_user."&nbsp; ".$last_user."
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
    • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
    • ¥16 mybatis的代理对象无法通过@Autowired装填
    • ¥15 可见光定位matlab仿真
    • ¥15 arduino 四自由度机械臂
    • ¥15 wordpress 产品图片 GIF 没法显示
    • ¥15 求三国群英传pl国战时间的修改方法
    • ¥15 matlab代码代写,需写出详细代码,代价私
    • ¥15 ROS系统搭建请教(跨境电商用途)
    • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。