473,387 Members | 1,721 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.

[CLOSED] Exited beginner

So far I understand the concept of sending a form to email using PHP, In this case as I understood it, using two separate pages of code, one html form and the other one php code page, combined them with <form method="post" action="phpPage.php">. Thanks to the comunity for sharing the knowledge...my form to email is working.

Next step is .... I need help to understand the concept of database, if I was wanting to gather the emails from my form and put it somewhere safe. What is the concept involved. I read so many articles already but I'm not sharp (dumb).

Is it like PHP + MYSQL + the page to store the data? can anyone explain it specially for my smaller brain the concept of this mighty database thing?.

I have access to my folders on my host
I'm comfortable with html and css
I still don't understand the logic of javascript but I can use the free scripts here and there on my pages.
The last few lines of information hopefully can help you to help me.

As alwayas thanks
Lodovikus
Sep 22 '06 #1
6 1595
ronverdonk
4,258 Expert 4TB
I understand that you want to store the email (you sent out), to an MySql database. To make it easier, to save the email data you can store it in the database with PHP code that in the same script that sends the email out.
Basically, you script would show something like (pseudocode)
Expand|Select|Wrap|Line Numbers
  1. acquire email data from $_POST array;
  2. construct all email message items;
  3. build email message;
  4. send out email message;
  5. if (email not sent successfully) {
  6.   issue error message;
  7.   exit or something else;
  8. }
  9. if (email sent successfully) {
  10.   connect to the database server;
  11.   connect to the database;
  12.   construct the variables holding the email text, the subject and the email To: address;  
  13.   insert above variable contents into db table;
  14.   close the db connection;
  15. }
I could send you code to acomplish this but, since you stated that you don't know much about MySql yet, please take some time (again) to read the PHP-MySql tutorial at http://www.php-mysql-tutorial.com/ and ask your questions here.

Ronald :cool:
Sep 22 '06 #2
Thank you Ronald,
I promise to follow through the MYSQL tutorials, but before I continue digging into the codes how can I accomplish MYSQL when my server is remote. Should I just type the codes and upload them to server? if so, what extension would be to use for MYSQL.

Also when I write MySQL codes using DOS, how can I upload this black screen DOS using FTP to my remote server?
thank you for your time

regards
Lodovikus
Sep 23 '06 #3
ronverdonk
4,258 Expert 4TB
I see that you are somewhat familiar with PHP. Now, all code to access MySql can be written in PHP. There are approx. 40 such mysql_ functions available for programmers in PHP of which you will normally not use more then 7 to 10. (see PHP functions ).

Usually, code is written in text format using an editor. This can be a simple one, such as Notepad in Windows or a highly sophisticated one, like Dreamweaver. Basically, you can use the simplest one if you only want to enter your code without any make-up.

About DOS, I don't really see how you can use your DOS screen as an editor. Or do you mean that you enter your mysql commands from the DOS screen and want to mark/copy them into a text editor? But then you'll still need PHP commands to send the MySql statements to the MySql database.

Hope this answers your questions on this.

Ronald :cool:
Sep 23 '06 #4

About DOS, I don't really see how you can use your DOS screen as an editor. Or do you mean that you enter your mysql commands from the DOS screen and want to mark/copy them into a text editor? But then you'll still need PHP commands to send the MySql statements to the MySql database.

Hope this answers your questions on this.

Ronald :cool:
yes sir... this is exactly what my confussion is where to write the MYSQL codes or to be exact where to write the data. Most articles I found on the internet are talking about writing codes via command prompt....How do I copy the codes from command prompt to a text editor and what extension I should save the MYSQL files under? I think I started to understand how to call MYSQL from PHP but still confuse how the data ( the MYSQL part) gets there in the first place.
I'm prepared to type every peace of MYSQL codes by hand in to text editor if that what it takes....yes I have and can use Dreamweaver but so far I only use it to edit html and css and never database.

as always thank you for your help
Regards
Lodovikus
Sep 24 '06 #5
ronverdonk
4,258 Expert 4TB
Let me give you a VERY OVERSIMPLIFIED overview of MySql commands in DOS command line and in PHP code line.

[php]Logging on to the server:
When you use MySql from the (DOS) command line, you start with something like:
mysql -u root -h localhost -p password
when you want to do the same in a PHP program, you do that in a textline with php code:
mysql_connect("localhost", "root", "password");

Connecting to the database:
DOS: use dbname;
PHP: mysql_select_db("dbname");

Issuing a SELECT:
DOS: select * from MyTable;
PHP: $Result=mysql_query("select * from MyTable");
mysql_fetch_row($Result);

Doing an INSERT:
DOS: insert into MyTable (id, name, address) VALUES ('01', 'John Doe', 'Fleet Street 10');
PHP: $id='01'; $name='John Doe'; $address='Fleet Street 10';
mysql_query("insert into MyTable (id, name, address) VALUES ('$id', '$name', '$address')");

Doing an UPDATE:
DOS: update MyTable set name='Joe Doe' where id='01';
PHP: $id='01'; $newname='Joe Doe';
mysql_query("update MyTable set name='$newname' where id='$id'");
[/php]
I hope you now can better see the difference between doing MySql via the command line and via a PHP program.
But I still insist that you learn some more MySql via the link I gave you.

Ronald :cool:
Sep 24 '06 #6
Hi Ronald,
I can't thank you enaugh for you time and effort,
I will apply those methods to my learning, I will let you know my progress
Regards
Lodovikus
Sep 26 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: T | last post by:
How do you catch the "Exited" event when a process is terminated. In the following code sample the "myProcess_Exited" event is never called. Any help would be appreciated. using System; using...
3
by: James | last post by:
Im having trouble building/running a program which was written under Visual Studio 2000 & .NET Framework 1.0. Im now using a new installation of .NET 1.1 with Visual Studio 2003, otherwise there...
2
by: Joseph V | last post by:
I have written a stored proceedure for MSSQL that needs to run for hours at a time. I need to execute it from C++ code. The current code does: nRet = SQLDIRECTEXEC(hstmt, "exec stored_proc",...
4
by: #kiss# | last post by:
hey guy !! i m a beginer on C prog...i m using DEV-C IDE but when i m running a .EXE the dos window open , run the .EXE and closed quickly, how could i do if i don't want the dos window...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
26
by: Rajeev Tipnis | last post by:
http://support.microsoft.com/default.aspx?scid=kb;en- us;819450 Questions: 1) Is this patch (fix) applicable to the .NET 1.1 Framework as well? That is, if we have Framework 1.1 (On...
11
by: asenthil | last post by:
Hai to all, i created a table in MYSql Database... And i have added 15 rows in it.... like the following.. asd, dff,
6
by: billiejoex | last post by:
Hi there. I'm setting up test suite for a project of mine. situations, if the socket is closed on the other end or not. I noticed that I can "detect" such state if a call to socket.read() returns...
9
by: kimiraikkonen | last post by:
Hello, I want to automate something and display a simple msgbox that indicates my external process finished processing and "exited". My code is that, what things should i add more: Dim psInfo...
11
by: minishilpi | last post by:
I have a question - I have this code below to send an email and I have referenced the Microsoft CDO Library 2000. It doesn't throw any exception in the console window. It goes throughout the code...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.