473,395 Members | 1,656 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,395 software developers and data experts.

php script that displays a form and inserts into mysql database

Rob
Hi everyone,

I am having trouble with this. I would like to combine a html form
and the php processing into one file and insert the info into mysql.

So a basic form which gets processed in the same script which also
inserts inot mysql whats the general syntax for that. does the php go
at the top or vise versa
Jul 17 '05 #1
2 1590
On 22 Jan 2005 02:58:44 -0800, ro*****@gmail.com (Rob) wrote:
I am having trouble with this. I would like to combine a html form
and the php processing into one file and insert the info into mysql.

So a basic form which gets processed in the same script which also
inserts inot mysql whats the general syntax for that. does the php go
at the top or vise versa


Well, there's many ways of doing it, but a simple idiom would be something
like:

if data received from form then
validate data
if data validated then
update database
if database update successful
display success page or redirect elsewhere
end script
end if
end if
end if

if validation or database update failed
display form with data plus any validation errors
else
display blank form
end if

--
Andy Hassall / <an**@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
DH
Rob wrote:
Hi everyone,

I am having trouble with this. I would like to combine a html form
and the php processing into one file and insert the info into mysql.

So a basic form which gets processed in the same script which also
inserts inot mysql whats the general syntax for that. does the php go
at the top or vise versa


Have a look at phpMyEdit v5.4
http://platon.sk/projects/release_li...p?project_id=5
Creates one script for Add, View, Change, coPy, Delete. Default display
is a searchable list of records. Numerous configuration options are
available. Perfect for administrative forms, can be adapted for publicly
available forms with a little effort.

Jul 17 '05 #3

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

Similar topics

0
by: Brian Murphy | last post by:
<?php /* I need your help. I'd be very thankfull if write me this script.I need a script that displays a list of categories and subcategories like this: <select name="category"> <option...
0
by: coding | last post by:
The purpose of the script below is to load the same news item into two different MySQL tables (thus displaying the same news item on two web pages). The problem I am having is this: The script...
1
by: JStrummer | last post by:
I just put together a PHP mailing list sign-up page that posts to a mySQL DB. The PHP script prevents INSERTs when the email address is already located in the database. Problem: I need to import...
2
by: jet | last post by:
Hi, Maybe this is an easy task, but I'm having a really hard time figuring out how to do this. I'm a complete newbie to SQL Server. I have a database dump file from MySQL that's in .sql...
1
by: Bob Sanderson | last post by:
I am relatively new to PHP and MySQL. This is the first time I've tried to use multiple queries in a single script. I have the following PHP script which gets a Job Number from a search form and...
9
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
3
tolkienarda
by: tolkienarda | last post by:
hi all i have a problem i have a script that i got working exactly the way i wanted it. and then i tried to intrigate it into the site and it totaly stopped working. below is the original code ...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
11
by: sshade25 | last post by:
I am trying to insert some data into my postgresql database table using an html form and a php script. The problem here is that when the script is run, it does not insert data into the last two...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.