Jump to content

extracting from DB and mail it out


droomagon

Recommended Posts

Currently i have 2 tables.

 

First table is the user information, and second table is the list of orders left by the user themselves.

 

So, what i'm trying to accomplish is... extract the list of orders from the second table, matching the first table by the sessionID (yes, the link between two tables are the sessionID recorded), then mail it out to the administrator.

 

I've been at this trying to figure this out for 2hrs... and still no clue how to proceed.

Link to comment
Share on other sites

$user_id = $_SESSION['user_id'];

$query = "SELECT * FROM user WHERE user_id = '$user_id'";
$result_user = mysql_query($query) or trigger_error(mysql_error());
$query = "SELECT * FROM orders WHERE user_id = '$user_id'";
$result_order = mysql_query($query) or trigger_error(mysql_error());

//Then user the results of those queries to form one string.

Link to comment
Share on other sites

well,

 

i don't have the working code yet, but i am trying to figure out how to do it... thus far i don't anything on paper...

 

basically what i want to do is, do a search of the database matching user's ID, and gets a list of things from the database, and then MAIL it out to the user and admin.

 

so far, i have no clue how to do it...

Link to comment
Share on other sites

there's is one example i can think of, that will relate to my question.

 

you know how you go to a shopping site, when u order things, and products would go to the shopping cart?

and when customer press the SUBMIT to order, the list of orders would be MAILED out to the customer's email.

 

that's what i am trying to accomplish

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.