sql question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hward
Forum Contributor
Posts: 107
Joined: Mon Apr 19, 2004 6:19 pm

sql question

Post by hward »

hi i need to have this return only the mem_userid's that are larger than 30000

Code: Select all

$sql = "SELECT mem_userid, mem_username, mem_email, mem_joindate, mem_sex, mem_country
	FROM $table_name
	ORDER BY mem_userid
	";
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

WHERE mem_userid > 30000

or similar
hward
Forum Contributor
Posts: 107
Joined: Mon Apr 19, 2004 6:19 pm

Post by hward »

ok what did i do wrong now

Code: Select all

$sql = "SELECT mem_userid, mem_username, mem_email, mem_joindate, mem_sex, mem_country
	FROM $table_name
	ORDER BY mem_userid WHERE mem_userid > 30000
	";
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it may want single quotes around the 30000
hward
Forum Contributor
Posts: 107
Joined: Mon Apr 19, 2004 6:19 pm

Post by hward »

tried that
hward
Forum Contributor
Posts: 107
Joined: Mon Apr 19, 2004 6:19 pm

Post by hward »

ahhhhhhh

Code: Select all

$sql = "SELECT mem_userid, mem_username, mem_email, mem_joindate, mem_sex, mem_country
	FROM $table_name
	 WHERE mem_userid > '30000'
	 ORDER BY mem_userid
	";
Post Reply