473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to send only last mysql data to email after submitting the form by customer?

After customer filling the form, the form data will be send to mysql, and an email will sent to me with the last form data that customer submitted. All is working, but only the problem is in the email "last mysql data" is not going as inline text. So, how to do this? I am doing in PHP. In am new in PHP. Please help me.

Please see the full code here - http://halmiratea.com/to-stackoverfl...l1.php#problem

Expand|Select|Wrap|Line Numbers
  1. $body                = 'Print the data';
  2. mysql_connect("localhost","XXXXXXX","XXXXXXX");
  3. @mysql_select_db("sandi565_form11");
  4. $query["SELECT * FROM demo ORDER BY ID DESC LIMIT 1"];
  5. $result = mysql_query($query);
  6.  
  7. //while ($row = mysql_fetch_array ($result)) {
  8. //  $mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; 
  9.   $mail->MsgHTML($body);
  10.   $address = "XXXXXXX@gmail.com";
  11.   $mail->AddAddress($address, "user2");
Jan 5 '13 #1
3 2481
Rabbit
12,516 Expert Mod 8TB
I'm not sure what you're asking here. Your SQL only returns one row.
Jan 7 '13 #2
If you see the full code an Mysql format, you can know that I want to send data (only the last mysql data which has been entered by last from submitter) to email as inline text . How can I make this thing happen? However, how can I make the SOL returns multiple row?

http://halmiratea.com/database.print.screen.png
Jan 8 '13 #3
Rabbit
12,516 Expert Mod 8TB
Your screenshot doesn't tell me anything, I don't see any SQL.

If you want to return more than one record, take out the limit clause.

I still don't understand what you're asking for, your English is unclear and vague.
Jan 8 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Akemi K. Buxton | last post by:
Hi, I'm a new PHP user so struggling a lot. I know this is silly question for you but I'll appreciate if you can help me. Here is my code. I need to send the data of $Sname in form1 to...
9
by: cooldv | last post by:
i know how to replace the sign " when SUBMITTING a form in asp by this code: message = Replace(usermessage, "'", "''"). My problem is DISPLAYING data in an asp FORM, from an an access database,...
1
by: Kenshin | last post by:
Hey! I have another script where i pull all the information from the database and I want to send it to the person. What they do is they enter in their email, and if the email matches, than it will...
2
by: serendipity | last post by:
Hi, I'm not sure if this is possible as i've googled everywhere, but i have a select query that returns a customer record with their associated sales orders. I would like to automate a process...
5
by: monomaniac21 | last post by:
Hi all Can anyone tell me how to submit a form to update its contents to a db and then from the page the form is submitted to then submit another form which is the payment processing data for a...
2
by: Msharma | last post by:
Hello all, This is my first flirtation with PHP and I could use some help on this. This is what I'm trying to do. I capture data from an HTML form and catch the data in a PHP script. Now I want to...
2
by: saiprasanthi | last post by:
Hi, Can you please tell what is the procedure in SQL Server 2000 to automatically send an email to the customer. I know that we can do it in DTS Packages. But what should be the code in the...
0
by: Zack00000 | last post by:
Hi Guys, I have a problem with the dll of MySql connector for .NET. To illustrate the problem, I have 3 projects: First one is a wrapper for log4net (it's a logging api), it is using...
2
by: metparker | last post by:
Hi everyone. I am trying to create a web form that will let search for records. the form will display the results on a screen that will enable the viewer to edit the record and then re-save it or...
0
amit sabal
by: amit sabal | last post by:
Hi, i m working on the code to send an email the selected record of the mysql database thru html page. all the records can be viewed on the thru select query ant after selecting the required check...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.