删除记录显示错误使用未定义的常量classid - asumed' classid'

时间:2017-04-03 02:10:06

标签: php mysql

在删除记录上获取错误"未定义的常量classid - asumed' classid'"

这是查询代码

         <?php

                $query = "SELECT `add_class`.`class_id` AS classid,`add_class`.`class` AS class_title, COUNT(*) AS 'total' FROM `add_class`  INNER JOIN `add_sec_class` ON (`add_class`.class_id = `add_sec_class`.class) GROUP BY `class_title` HAVING COUNT(*) >= 1";

                include("include/my_pagina_class.php");
                $test = new MyPagina;
                $test->sql = $query; // the (basic) sql statement (use the SQL whatever you like)
                $test->rows_on_page = 50;
                $result = $test->get_page_result(); // result set
                $num_rows = $test->get_page_num_rows(); // number of records in result set
                $nav_links = $test->navigation(" | ", "currentStyle"); // the navigation links (define a CSS class selector for the current link)
                $nav_info = $test->page_info("to"); // information about the number of records on page ("to" is the text between the number)
                $simple_nav_links = $test->back_forward_link(); // the navigation with only the back and forward links
                $total_recs = $test->get_total_rows(); // the total number of records
                //echo $errNo;
                $rowCount = 1;
                $listRows = $total_recs;
                $counter = 1;
                while($row = mysql_fetch_array($result))
                {
                      $counter++;

              ?>
                <tr>
                  <td height="22" align="center"><input type="checkbox" name="CheckBoxChild" id="CheckBoxChild" value="<?=$row[classid]?>" onclick="SelectChildCheckBox(this.form,'CheckBoxParent','CheckBoxChild');" /></td>

                  <td><?=$row['class_title']?></td>
                  <td><?=$row['total'] ?></td>
                  <td></td>
                  <td></td>
                  <td><a href="<?=$_SERVER['PHP_SELF']?>?id=<?=$row[classid].''.rebuild_qstring("id")?>">Edit</a></td>
                </tr>
              <?php }?>

这些是我的表

table1 name&#34; add_sec_class&#34; 列是:d_id,class,division,ddate,username,acadmic_year,status

table2 name&#34; add_class&#34; 列是:class_id,class,acadmic_year,status,display _order,fee

现在应该写什么而不是$ row [classid],我不确定查询中需要什么样的更改。

提前感谢您的宝贵时间

0 个答案:

没有答案