homepage Welcome to WebmasterWorld Guest from 54.166.110.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Help with forms
jlbrown16




msg:4569627
 10:38 am on May 1, 2013 (gmt 0)

Hello all,

Sorry If i'm in the wrong place and sorry if i'm asking too much.

I have a html form that I need to insert/retrieve data to a local mysql database.

Can anyone offer me some advice on how to get the form to r/w to Mysql?

 

rainborick




msg:4569694
 3:25 pm on May 1, 2013 (gmt 0)

Storing form submission data in a database isn't terribly complicated on a fundamental level. You start by creating a database that has a table with fields that correspond to the form fields. Then your PHP scripts simply gather the form submission data and handles the interaction with the database server to store and retrieve that data as needed. But things do get a bit complicated when you start to consider issues like website security, form data validation, data formats, and a handful of other issues.

I'd suggest that you search for PHP tutorials on forms and MySQL. That will get you started. Once you have the basics down, you can investigate some of these other topics.

jlbrown16




msg:4569701
 3:44 pm on May 1, 2013 (gmt 0)

Thanks that's the sort of guidance i need.

I know roughly what i need to do just don't know how to put it in to practice and seen that i haven't done it before I dont know for sure that i'm getting all the elements right.

I have prepped my Mysql database with the correct database and fields, I just need to read up on some php to figure out how to get my data in there.

Quick question, from what i gather i can do the same thing with ASP, is this correct? and is there a reason PHP would would be preferable?

reffik024




msg:4574459
 5:38 pm on May 15, 2013 (gmt 0)

Two different systems, ASP runs on Windows servers, PHP runs on linux. On a basic form there's no huge difference, just comes down to personal preference.

reffik024




msg:4574460
 5:38 pm on May 15, 2013 (gmt 0)

Two different systems, ASP runs on Windows servers, PHP runs on linux. On a basic form there's no huge difference, just comes down to personal preference.

swa66




msg:4574535
 10:09 pm on May 15, 2013 (gmt 0)

Since you're learning, make sure to use the mysqli (note the i) interface, not the obsolete mysql (note the lack of the i) interface. I'd invest a bit of time to fully get to grasps with prepared statements - they make it a lot easier to get rid of sql injection problems.

BTW: PHP is available on windows platforms as well.

reffik024




msg:4574786
 7:58 pm on May 16, 2013 (gmt 0)

On Windows platforms yes, but not windows servers right?

swa66




msg:4574813
 9:07 pm on May 16, 2013 (gmt 0)

You can run php under IIS on windows servers (that's what I meant by windows platform).

See here for instructions on how to do it manually: [php.net...]
See here for an msi installer: [php.net...]

Not that I've done so: "I don't do windows"

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved