Databse query
Posted: 27 November 2008 02:37 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  174
Joined  08-18-2003

Can some one please write a dql query so I can do the folwoing.

Retreive the names ans emails of all people in my database

Profile
 
 
Posted: 27 November 2008 03:06 PM   [ Ignore ]   [ # 1 ]  
Lab Assistant
RankRank
Total Posts:  115
Joined  04-23-2006

SELECT name_field_name, email_field_name FROM table_name

Profile
 
 
Posted: 27 November 2008 03:10 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  174
Joined  08-18-2003

MySQL ERROR:

Error Number: 1146

Description: Table ‘database875389.table_name’ doesn’t exist

Query: SELECT SQL_CALC_FOUND_ROWS name_field_name, email_field_name FROM table_name LIMIT 0, 100

It produced no output. Is there anything I have to modify?

Profile
 
 
Posted: 27 November 2008 04:00 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7061
Joined  04-15-2006

Try,

{exp:query sql="SELECT email, username, screen_name FROM exp_members"}
<p>{email} - {username} - {screen_name}</p>
{/exp:query}

I think what EugeneS was showing above was more a generic fill it in yourself type of query wink

Hope that helps a bit.

You could also go further with this and just return the member_id and then embed or place the Custom Profile Field Tag within the query to get at all their information but that’s for another day perhaps? wink

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 66389 Total Logged-in Users: 39
Total Topics: 84714 Total Anonymous Users: 18
Total Replies: 454693 Total Guests: 189
Total Posts: 539407    
Members ( View Memberlist )