56,679
社区成员
发帖
与我相关
我的任务
分享
select a.name, b.sex,b.image
from user a,pic b
where a.id=b.id
DROP TABLE IF EXISTS `cloudentrysystem`.`m_user`;
CREATE TABLE `cloudentrysystem`.`m_user` (
`Seqno` int(11) NOT NULL AUTO_INCREMENT,
`UserID` varchar(8) NOT NULL DEFAULT '',
`Pass` varchar(8) DEFAULT NULL,
`Mail` varchar(100) DEFAULT NULL,
`UserLevel` tinyint(4) NOT NULL DEFAULT '4',
`Valid` tinyint(4) DEFAULT '1',
`CompanyID` int(11) DEFAULT NULL,
`ContactSection` varchar(30) DEFAULT NULL,
`ContactFamilyName` varchar(20) DEFAULT NULL,
`ContactGivenName` varchar(20) DEFAULT NULL,
`ContactTel` varchar(11) DEFAULT NULL,
`ContactFax` varchar(10) DEFAULT NULL,
`ContactMail` varchar(100) DEFAULT NULL,
`RegistDate` datetime DEFAULT NULL,
`DeleteDate` datetime DEFAULT NULL,
PRIMARY KEY (`Seqno`,`UserID`),
KEY `CompanyID` (`CompanyID`),
CONSTRAINT `m_user_ibfk_1` FOREIGN KEY (`CompanyID`) REFERENCES `m_company` (`CompanyID`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `cloudentrysystem`.`m_company`;
CREATE TABLE `cloudentrysystem`.`m_company` (
`CompanyID` int(10) NOT NULL AUTO_INCREMENT,
`CompanyName` varchar(100) DEFAULT NULL,
`CompanyPostCode` varchar(15) DEFAULT NULL,
`CompanyAddress` varchar(200) DEFAULT NULL,
`CompanyTel` varchar(11) DEFAULT NULL,
`CompanyFax` varchar(10) DEFAULT NULL,
`CompanyEstablishedDate` year(4) DEFAULT NULL,
`CompanyEmployeeNumber` int(10) unsigned DEFAULT NULL,
`CompanyURL` varchar(200) DEFAULT NULL,
`CompanyMemo` varchar(200) DEFAULT NULL,
`CompanyEvidence` blob,
PRIMARY KEY (`CompanyID`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;
select a.mail as Mail,
a.pass, -- 加了就查不出,,,万分奇怪
a.contactsection as contactsection,
a.contactfamilyname as contactfamilyname,
a.contactgivenname as contactgivenname,
a.contacttel as contacttel,
a.contactfax as contactfax,
a.contactmail as contactmail,
b.companyname as companyname,
b.companypostcode as companypostcode,
b.companyaddress as companyaddress,
b.companytel as companytel,
b.companyFax as companyFax,
b.companyestablisheddate as companyestablisheddate,
b.companyemployeenumber as companyemployeenumber,
b.companyURL as companyURL,
b.companyMemo as companyMemo,
b.companyevidence
from
m_user a,m_company b
where
a.companyid=b.companyid;