Page 1 of 1
small query issue.
Posted: Sun Dec 18, 2005 4:54 am
by itsmani1
Code: Select all
mysql_query("CREATE TABLE education (
pid bigint(50) NOT NULL auto_increment,
userid bigint(50) NOT NULL default '0',
qualification int(11) NOT NULL default '0',
) ";
mysql_query("
CREATE TABLE user (
userid bigint(100) NOT NULL auto_increment,
email varchar(255) NOT NULL default '',
city varchar(255) default NULL,
contacted varchar(50) NOT NULL default '',
notes varchar(255) NOT NULL default '',
one varchar(50) NOT NULL default '',
two varchar(50) NOT NULL default '',
three varchar(50) NOT NULL default '',
PRIMARY KEY (userid)
)");
Now i need a query where i can select user.email, user.city and education.qualification order by education.qualification.
thanx in advance.
Mannan.
Re: small query issue.
Posted: Sun Dec 18, 2005 7:00 am
by ody
Code: Select all
mysql_query("CREATE TABLE education (
pid bigint(50) NOT NULL auto_increment,
userid bigint(50) NOT NULL default '0',
qualification int(11) NOT NULL default '0',
) ";
should be:
Code: Select all
mysql_query("CREATE TABLE education (
pid bigint(50) NOT NULL auto_increment,
userid bigint(50) NOT NULL default '0',
qualification int(11) NOT NULL default '0'
);");
The query you need is:
select user.email, user.city from user, education where user.userid = education.userid order by education.qualification
Check
this out.
Posted: Sun Dec 18, 2005 7:12 am
by onion2k
Everyone hopes that their website is a huge success .. but using bigint(100) for your contact id is a bit silly.. That could hold approximately 17,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 times the number of people on the planet. Inserting 1000 contacts a second would take 5,390,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 years to fill the table.
Posted: Sun Dec 18, 2005 6:34 pm
by John Cartwright
onion2k wrote:Everyone hopes that their website is a huge success .. but using bigint(100) for your contact id is a bit silly.. That could hold approximately 17,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 times the number of people on the planet. Inserting 1000 contacts a second would take 5,390,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 years to fill the table.
Some one is bored

Posted: Tue Dec 27, 2005 6:11 am
by itsmani1
thanx every one for your comments.
Happy New Year