drep94225 2011-06-05 15:34
浏览 57
已采纳

简单计划 - 架构数据库

I would like to make a simple plan: enter image description here I did something like this:

CREATE TABLE IF NOT EXISTS `plan` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `a` varchar(25) NOT NULL,
  `b` varchar(25) NOT NULL,
  `c` varchar(25) NOT NULL,
  `d` varchar(25) NOT NULL,
  `e` varchar(25) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

but it doesn't work too well...

I wish that every cell has a unique ID in TD.

Now is:


    foreach($rows as $row)
    {
          
          id(); ?>>id() ?>
          id(); ?>>A() ?>
          id(); ?>>B() ?>
          id(); ?>>C() ?>
          id(); ?>>D() ?>
          id(); ?>>E() ?>
            
    }

and now i can't refer to a single TD. i wold like edit for example only ID: 20.

how best plan database?

thanks for help!

  • 写回答

1条回答 默认 最新

  • dptgpyl61857413 2011-06-05 15:42
    关注

    Every cell/<td> doesn't need an ID. Put the ID on the row/<tr>, as you've done in your database schema.

    After that it should be a trivial task to identify the different columns per row.

    The database:

    | id | a | b | c | d | e |
    --------------------------
    | 1  | t | t | t | t | t |
    

    The HTML:

    <table>
        <tr>
            <th>id</th>
            <th>a</th>
            <th>b</th>
            <th>c</th>
            <th>d</th>
            <th>e</th>
        </tr>
        <tr class="id-1">
            <td class="id">1</td>
            <td class="a">t</td>
            <td class="b">t</td>
            <td class="c">t</td>
            <td class="d">t</td>
            <td class="e">t</td>
        </tr>
        <tr class="id-2">
            <td class="id">2</td>
            <td class="a">u</td>
            <td class="b">u</td>
            <td class="c">u</td>
            <td class="d">u</td>
            <td class="e">u</td>
        </tr>
    </table>
    

    Or I've misunderstood you ;)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来