iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-01-2008, 06:34 AM
edhan's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Singapore
Posts: 716
edhan RepRank 3edhan RepRank 3edhan RepRank 3
Question How to extract emails from table?

Hi

How can I write in php to extract emails corresponding to a database table from the usernames?

Example:

Table name as records

Fields are: userid, username, password, emails, description, height, weight

Let says a few usernames like peter, william, charles are selected as array from the table. How do I extract their emails from the same table? The usernames selected are random and are displayed. Now I want to select the corresponding emails with these usernames, how can I accomplish this?

Any help will be appreciated. Thanks!
Reply With Quote
  #2 (permalink)  
Old 11-04-2008, 12:58 AM
edhan's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Singapore
Posts: 716
edhan RepRank 3edhan RepRank 3edhan RepRank 3
Default Re: How to extract emails from table?

Is there any easier way to just submit names and retrieve emails result?

Say a person keys in peter, william and then submit

The result will extract the emails based on the names key in as peter, william and displaying the emails.

Is there a way to do this? Or it is not possible?
Reply With Quote
  #3 (permalink)  
Old 11-04-2008, 10:48 AM
Dubbya's Avatar
WebProWorld 1,000+ Club
WebProWorld MVP
 
Join Date: Nov 2006
Location: Steinbach, Manitoba, Canada
Posts: 1,300
Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4Dubbya RepRank 4
Default Re: How to extract emails from table?

This seems like a pretty basic query.

This page should help you get started:

PHP SQL Select Query and Getting rows
Reply With Quote
  #4 (permalink)  
Old 11-04-2008, 09:58 PM
edhan's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Singapore
Posts: 716
edhan RepRank 3edhan RepRank 3edhan RepRank 3
Smile Re: How to extract emails from table?

Thanks for pointing me the direction, Dubbya. I am checking it out and test to see if it works for me. Will let you know the result.

Thanks again!
Reply With Quote
  #5 (permalink)  
Old 11-09-2008, 06:48 AM
edhan's Avatar
WebProWorld Veteran
 
Join Date: Aug 2003
Location: Singapore
Posts: 716
edhan RepRank 3edhan RepRank 3edhan RepRank 3
Default Re: How to extract emails from table?

Hi Dubbya

Well, I have been experimenting with the link you have provided but still can't figure out how to do it. Hope someone can point to an example where I can get started.

Thanks anyway Dubbya.
Reply With Quote
  #6 (permalink)  
Old 11-15-2008, 08:58 AM
WebProWorld Veteran
 
Join Date: Jul 2003
Location: Spain
Posts: 343
computergenius RepRank 1
Default Re: How to extract emails from table?

It's not really as simple as it first looks.

The SQL command that you want is
SELECT emails
FROM records
WHERE username in ("peter", "william" )

You need quotes around the usernames, which you will have to add in via some code.

Exactly how you acheive this, depends on what you are using to accept input from the user.
__________________
Pete Clark
Got any spare time? Anything you need? Barter in Spain at http://BarterWithBart.com
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract database code edhan Database Discussion Forum 1 09-24-2007 05:31 AM
How to Extract result from xml file? tricker Web Programming Discussion Forum 1 12-22-2006 09:49 AM
Extract all resources from any SWF file Decompile_SWF Flash Discussion Forum 0 10-15-2005 05:46 AM
Table layout using php/mysql to extract golf statistics daddyg Web Programming Discussion Forum 8 08-18-2005 02:43 AM
Is there a tool that can extract search results? MathsIsFun Google Discussion Forum 0 02-01-2005 10:03 PM


All times are GMT -4. The time now is 08:30 AM.



Search Engine Optimization by vBSEO 3.3.0