#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    61
    Rep Power
    15
    I may be making this harder than it has to be. I wish to read the contents of a number of rows from a mySQL table and send it via email. I am having a hard time picturing in my mind how to grab this information and place it into a message line, which will be used in the mail() line.

    Here is what I have in mind but can't get it to quite gel.

    ****************
    $message = " Below is a list of items. nn".$datagroup;
    /* where datagroup is possibly an array of the data */
    mail(someone@there.com, "Your Order", $message,"From:me@here.com");

    ****************

    Is there a way to place an array into $datagroup in some sort of table form?

    As an example lets assume we are using a shopping cart and the fields are prodID , description, price, and quantity. I can read the values into my program, I am just having trouble with what to do with them.

    Where do I go from here?

    Thanks,
    stujohnson
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    7
    Rep Power
    0
    Hey man...
    try

    explode() with the delimiter "n"

    $datagroup = "piece1 piece2 piece3 piece4 piece5 piece6";
    $message = explode ("n", $datagroup);

    $message should look like....
    prodIDn
    descriptionn
    pricen
    quantityn

    then throw your:
    mail(someone@there.com, "Your Order", $message,"From:me@here.com");

    i haven't tested it but that should help ....
    let me know. if it did
    ccbcreg

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by stujohnson:
    I may be making this harder than it has to be. I wish to read the contents of a number of rows from a mySQL table and send it via email. I am having a hard time picturing in my mind how to grab this information and place it into a message line, which will be used in the mail() line.

    Here is what I have in mind but can't get it to quite gel.

    ****************
    $message = " Below is a list of items. nn".$datagroup;
    /* where datagroup is possibly an array of the data */
    mail(someone@there.com, "Your Order", $message,"From:me@here.com");

    ****************

    Is there a way to place an array into $datagroup in some sort of table form?

    As an example lets assume we are using a shopping cart and the fields are prodID , description, price, and quantity. I can read the values into my program, I am just having trouble with what to do with them.

    Where do I go from here?

    Thanks,
    stujohnson
    [/quote]



    ------------------
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    61
    Rep Power
    15
    Not exactly what I was looking for but it helped with my next problem.

    What I ended up doing was to go with my original thought of having the user visit a secure site with password protection.

    Time is running out on this project and the web page route will work. Once the deadline is met I will revisit this to learn more.

    Thanks for the help.

    stujohnson
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2000
    Posts
    7
    Rep Power
    0
    i hear ya,
    if you need anything .... feel free to e-mail myself and i would love to help.
    ccbcreg

IMN logo majestic logo threadwatch logo seochat tools logo