droomagon Posted October 16, 2009 Share Posted October 16, 2009 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. Quote Link to comment Share on other sites More sharing options...
waynewex Posted October 16, 2009 Share Posted October 16, 2009 $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. Quote Link to comment Share on other sites More sharing options...
droomagon Posted October 16, 2009 Author Share Posted October 16, 2009 Thanks waynewex for the quick reply... its the part that mail() is bugging the heck out of me, i'm not sure HOW to do it.. must have a brainfart lately...>< Quote Link to comment Share on other sites More sharing options...
cags Posted October 16, 2009 Share Posted October 16, 2009 What exactly about mail is bugging the heck out of you? Do you not have a clue where to start, have you tried and it's not working? You need to be more specific. Quote Link to comment Share on other sites More sharing options...
droomagon Posted October 21, 2009 Author Share Posted October 21, 2009 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... Quote Link to comment Share on other sites More sharing options...
droomagon Posted October 21, 2009 Author Share Posted October 21, 2009 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.