SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2005
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Email addresses in database.

    Hi All,

    I want to store email addresses in mysqldatabase,which are inputted in html form in one field.

    For example:
    let's say

    Email-Addresses: abc@yahoo.com,xyz@yahoo.com

    I amnot sure how to define table for this.Could anyone of you help me in this.

    Thanks
    bindu

  2. #2
    SitePoint Evangelist -Oz-'s Avatar
    Join Date
    Nov 2001
    Location
    Phoenix, AZ, USA
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if they're always going to be sperated by commas you could just explode the input by commas, trim out any whitespace, and put each one in a different row in the table.
    PHP Code:
    $email_sep explode(" "$emails); 
    Now $email_sep[0] has the first address, $email_sep[1] has the second, etc.

    if you dont mind the whitespace don't do the trim, otherwise you have to trim each element of the array (use a foreach or while loop).
    Last edited by -Oz-; May 14, 2005 at 08:52. Reason: add more info
    Oz
    GamersMark - On Target Gaming
    OzTheory - Programming and Web Solutions
    AmIBlocked - Check if you've been blocked on IM


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •