Log in

View Full Version : Looking for Script PDO, SQL, PHP



mcolton
04-24-2014, 05:23 PM
Not sure I'm in the right place. I have working scripts that have users do the following:
fill in a forms and have the results added or edited to a mysql database.

I've been told that my code is awkward and old. I need some help with PDO to maybe rewrite my existing code.
Any help in the right direction is greatly appreciated.

traq
04-25-2014, 12:27 AM
Are you looking to learn and do it yourself, or to hire someone to do it for you?

mcolton
04-25-2014, 01:34 AM
Myself. I've done all my previous coding

traq
04-25-2014, 01:48 AM
You'll need to read up on PDO (http://php.net/pdo) and give it a try, then. Once you have specific questions, post back here, and include your code so we know what's going on.

mcolton
04-25-2014, 10:12 AM
Is there a good PDO tutorial. I've looked at some and was really confused

traq
04-25-2014, 06:13 PM
IMO, the best place to start is the PHP manual (that's what I linked to). Start with the __construct (http://php.net/pdo.__construct) method, look through the examples, and then follow the links to other methods as you discover them.

Can you give a specific example of something you were confused about? We'd be happy to help.

mcolton
04-29-2014, 12:23 PM
I was going to send you my program files so you could tell me if I REALLY need to change anything but the forum won't allow me to send .php files

traq
04-29-2014, 09:17 PM
For files that are too big to post in a thread, your best option is an online service like github or pastebin. File attachments don't usually get a good response on forums these days.

You should obfuscate any sensitive information in your files (usernames, passwords, api keys, etc.) before sharing.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~

As for whether or not you "really" need to change anything, the answer is probably "yes." The mysql_* functions are deprecated, and have been outdated for ten years. Most code ever written with them is awful.

mcolton
04-30-2014, 10:07 AM
I'll be gone for a couple of weeks so I'll respond mid May. Thanks for the help