Article View: cn.bbs.comp.database
Article #945Re: ����̡�mysql����
From: wayfarer
Date: Mon, 01 Sep 2008 13:00
Date: Mon, 01 Sep 2008 13:00
24 lines
1808 bytes
1808 bytes
���id������ӵģ����todo����ԭ��û��primary key�
�� �� crazymans (����������) �Ĵ������ᵽ: ��
����һ���Ѿ����ڵ���Ϊ��todo���ı���������һ��id���������£�
mysql> ALTER TABLE todo ADD id INT NOT NULL AUTO_INCREMENT PRIMARY KEY;
Ȼ����perl����ݿ��ж�ȡ��ݵ�ʱ���֣�Ҫƥ��id��ʱ��ֻ���á�where id like
�����ſ��ԣ����£�
$sth = $dbh->prepare("SELECT * FROM todo where id like ?");
$sth->execute($id);
���Dz������á�where id= �������������
$sth = $dbh->prepare("SELECT * FROM todo where id like ?");
$sth->execute($id);
�����Ͱ���û�з�Ӧ��Ҳû�б���ʲô�ġ�
���ʸ��֣�������ô�����أ���
--
�����ğo�࣬��������
�������o�ģ������Ĝ硿
--
[m[1;32m�� ��Դ:����ˮ˼Դ bbs.sjtu.edu.cn��[FROM: 58.33.71.25][m
Technical Details
Message-ID:
<4bg0cF$bGe@bbs.sjtu.edu.cn>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cuhk.edu.hk!news.neu.edu.cn!news.shec6.edu.cn!SJTUShow Full Headers
Complete Article Headers
X-Google-Thread: 101948,8912d7db37f2aa83,start X-Google-Attributes: gid101948,domainid0,public,usenet X-Google-Language: Chinese,GB Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsgate.cuhk.edu.hk!news.neu.edu.cn!news.shec6.edu.cn!SJTU From: wayfarer.bbs@bbs.sjtu.edu.cn (wayfarer) Newsgroups: cn.bbs.comp.database Subject: Re: ����̡�mysql���� Date: 01 Sep 2008 13:00:07 GMT Organization: ��ˮ˼Դ Message-ID: <4bg0cF$bGe@bbs.sjtu.edu.cn> Mime-Version: 1.0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: 8bit X-Filename: database/M.1220273967.A