Page 1 of 1

need some mysql and php pointers

Posted: Mon Sep 28, 2009 3:54 am
by leegreaves
Im a newbie and need some pointers

I recently started a website up (tho its still mainly in the construction stages and not fully up n running). Ive inititially created a startup database, but now for the hard part. Ill need to link various pages on my site to the database and i need some simple pointers about wot i need to consider when it comes to writing up the php code to link it all together. What should i consider when it comes to, ive racked my brains over this cos im very inexperienced with php code, would it be better to find code snippets from a site and change it to work with my site or should i write it from scratch? I did ask in another forum post on here about getting a lot of help but i feel that is a bit much to ask for, I know i could download scripts and use those for my project but, if i come across any hurdles i would be lost as to sorting them out, does anyone know where i could go to and find out how to do this totally from scratch. Ive got an idea in my head how i want it to work, itll be like any other site, a user registers their info, this info is inserted to the database as a new entry; so when they revisit its just a simple login procedure (i do have a login script on the home page but i cant even get that to work properly). Damn ppl reading this must be thinking what a sad muppet...BUT...if theres anyone out there who knows a site i can go to to find out how to do this totally then be my guest and let me know

Re: need some mysql and php pointers

Posted: Mon Sep 28, 2009 4:48 am
by lord_webby
http://www.tizag.com/mysqlTutorial/

Best to use other's code to a certain extent. That should cover pretty much everything you need to do with php/mysql.

Re: need some mysql and php pointers

Posted: Mon Sep 28, 2009 4:49 am
by lord_webby

Re: need some mysql and php pointers

Posted: Mon Sep 28, 2009 5:53 am
by leegreaves
would u consider it a bit foolish for a newbie like myself to jump right in at the deep end!!! lol

anyway, the 2nd of the tutorial links u gave me there ive already come across thru a search...unfortunately i felt that it only covered a little of what i needed to acquire in my goals. This is only due to the fact that what i am trying to achieve with my site involves more processes than that is covered in it. oh well never mind

Re: need some mysql and php pointers

Posted: Mon Sep 28, 2009 6:18 am
by lord_webby
it may look like the deep end - but in terms of php and mysql that's about as shallow as you're going to get.

If you want more on php however:
http://www.w3schools.com/PHP/DEfaULT.asP

I'm guessing you've already got to grips with html? What site are you trying to build?

Re: need some mysql and php pointers

Posted: Thu Oct 01, 2009 2:56 am
by leegreaves
im building a members only site which requires a user to login in with the usual username and password (which is encrypted md5 style in my database). Once ive got the login to work then i can add a session alive statement to ensure that they dont get logged out each time they goto a different page on the site.

Re: need some mysql and php pointers

Posted: Thu Oct 01, 2009 3:53 am
by lord_webby
This should help but don't store as cookies - store as session variables instead. It will prevent a lot of security issues. Make sure everything is encrypted when stored.

Passwords should be salted before hashing.

http://php.about.com/od/finishedphp1/ss ... n_code.htm