Results 1 to 3 of 3

Thread: How to use result of query as a variable?

  1. #1

    Afrostyle How to use result of query as a variable?

    Hello,
    So I have a content management site set up, but I'm stuck on one part. I have a query
    Code:
    Select `email` FROM author WHERE author.id IN(SELECT authorid FROM job WHERE id = '$_POST[id]')
    . I'm a beginner in PHP and SQL. Basically I need the query to run, it will come out with one result and I need that to be where the email is sent to. This is the existing code I have for sending out the email
    PHP Code:
    $subject " Job Application Confirmation";

    $message "Hello $_POST[name] , \r\rYou, or someone using your email address, has applied for the job: $text Using the Resource Locator at Prahan.com. Keep this as future reference. \r\r Full Name: $_POST[name] \r Location: $_POST[location] \r Email: $_POST[email] \r Additional Information: $_POST[info] \r Job ID: $id  \r Job Name: $text  \r \r Expect a response shortly. \r\r Regards, Prahan.com Team";

    $headers 'From: Prahan.com Team <noreply@prahan.com>';

        
    'Reply-To: noreply@prahan.com' "\r\n" .

        
    'X-Mailer: PHP/' phpversion();

    $to1      'pratik@prahan.com';

    mail($to1$result$message$headers); 
    Thanks in Advance!

  2. #2
    Can you give a little more information?

    I understand you are trying to send an email, but will this be after a user fills out a form or what?

    Thanks,
    Brandon

  3. #3
    Quote Originally Posted by drummer392 View Post
    Can you give a little more information?

    I understand you are trying to send an email, but will this be after a user fills out a form or what?

    Thanks,
    Brandon
    Yes, so basically a user selects a job. The job id gets saved in the session. The user fills out a form. And i need the contents of the form to be sent to the author of the job.

    My application is running here: http://prahan.com/jobs/jobs.php

    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012