关于一个数据库下两个数据表

来源:百度知道 编辑:UC知道 时间:2024/06/15 22:17:10
比如说某一页面shop_list.asp?shop_id=1,我要对他进行评论,我想将评论的内容放在comment数据表里,跟shop数据表分开,怎么样做才好呢?谢谢大家,我的想法是通过shop_id传递,但是我不知道在comment里面怎么样将该页面shop_id传到comment里面
能不能详细的,谢谢
bengboba,我用sql你的答案我还没掌握,谢谢

两个表通过 shop_id 来关联!

shop_id = Request("Shop_id")

qq:75594393

sql语句:

strSQL="UPDATE tableA SET 字段名=你的写入的值,字段名=你的写入的值 where shop_id="&Request("Shop_id")&""

如果这还不明白的话,就不知道是我没理解你的意思,还你应该看看基础类的书了!

create table shop
{
shop_id VARCHAR2(10),
shop_name VARCHAR2(20),
constraint PK_COMMENT primary key ("shop_id")
};

create table comment
{
shop_id VARCHAR2(10),
comment VARCHAR2(100),
constraint PK_COMMENT primary key ("shop_id");
}

alter table comment
add constraint FK_SHOP_REFERENCE_COMMENT_
foreign key ("shop_id")
references shop ("shop_id")
on delete cascade;