Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
pass auto_increment value into a php email when form is submitted???
Old 06-06-2005, 01:25 PM pass auto_increment value into a php email when form is submitted???
Phunky's Avatar
Skilled Talker

Posts: 68
Location: NJ
Trades: 0
Hello...

I am creating a form for my company... When the form is submitted an auto_incremented ID field is created... This record is important because the person needs to enter it 30 days later so they can add a "follow-up report"...

I have gotten it to show up on my "formResults.php" page using two lil blocks of code...

PHP Code:
<?php

// this is in the head... the query selects the recordID field as rID 

$query2 "SELECT recordID AS rID FROM emp_ad_records WHERE empID='$empID'";
$loginUsername mysql_query($query2) or die(mysql_error()); 

?>

<?php
// in order to extract the info I need and print it on the page I am running this little code in the spot where it is to print:

while ( $row mysql_fetch_assoc($loginUsername) )     
 { 
   echo 
"<span style='color:#FFFFFF;'>#".$row['rID']."</span>"
  }
  
?>
I tried doing something similar in the part of the code where I create the mail body

I created an identical variable (just has a different name):

PHP Code:
<?

$recID 
= while ($myrow mysql_fetch_assoc($loginUsername))
 { 
   echo 
$myrow["rID"];
  }

?>
and then called $recID like anyother variable in the mail field... But nothing shows up in the email...

I have been stuck on this for a few and would appreciate some fresh input! Has anyone dealt with a similar problem before?

thanks,

Pat
__________________
But dreaming just comes natural
Like the first breath from a baby,
Like sunshine feeding daisies,
Like the love hidden deep in your heart.

~J.Prine
Phunky is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-06-2005, 03:01 PM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
You might want to take a look at this thread: http://www.webmaster-talk.com/showthread.php?t=29929 which i started about a pretty similar thing. It may be easier just to create a unique ID yourself, using date and time and then 34 or 4 random numbers, altho this could be too long (today would be: 0606052000123)

Take a look at the thread and if it don't help we'll see if we cant get a bit more indepth with it
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Old 06-06-2005, 05:08 PM
Phunky's Avatar
Skilled Talker

Posts: 68
Location: NJ
Trades: 0
Quote:
Originally Posted by leavethisplace
You might want to take a look at this thread: http://www.webmaster-talk.com/showthread.php?t=29929 which i started about a pretty similar thing. It may be easier just to create a unique ID yourself, using date and time and then 34 or 4 random numbers, altho this could be too long (today would be: 0606052000123)

Take a look at the thread and if it don't help we'll see if we cant get a bit more indepth with it
thanks for the link... I was running into the same problems trying to work with this, since I still needed to query the database...

I took your advice though and created a unique number using the date function! Great idea!

I used:

PHP Code:
$recID =  date('mdyB'); 
then I can call that like a normal variable!!! Definatly works! Thanks for the help!
__________________
But dreaming just comes natural
Like the first breath from a baby,
Like sunshine feeding daisies,
Like the love hidden deep in your heart.

~J.Prine
Phunky is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to pass auto_increment value into a php email when form is submitted???
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.40435 seconds with 12 queries