Every field but Primary Key???
| From: | Wee Chua | Date: | Tue, 10 Oct 2000 18:54:58 +0000 |
| Subject: | Every field but Primary Key??? | ||
| Groups: | php.db php.general | ||
| Request: | Send a blank email to php-general+get-19407@lists.php.net to get a copy of this message | ||
Hi all,
how could I display all fields but the primary keys after the join
statement? Does anyone have any ideas about it? How to use the php codes to
do this? Thanks for any help.
$sql = "SELECT * FROM CaseEvent, CaseType";
$result = mysql_query($sql, $db);
$rows = mysql_num_rows($result);
$fields = mysql_num_fields($result);
Here are the tables that associated with:
CREATE TABLE CaseEvent (
FKCase_ID int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (FKCase_ID,FKEvent_ID),
KEY FKCase_ID (FKCase_ID,FKEvent_ID)
);
CREATE TABLE CaseType (
CaseType_ID int(11) DEFAULT '0' NOT NULL auto_increment,
Type char(25) DEFAULT '' NOT NULL,
PRIMARY KEY (CaseType_ID),
UNIQUE UC_Type (Type)
);
Calvin