Home > Archive > PHP Language > January 2006 > Good PHP examples for MySQL calls..
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Good PHP examples for MySQL calls..
|
|
| Geir Holmavatn 2006-01-22, 7:02 pm |
| Hi,
I'm a newbie and I want to learn PHP and use it to display and edit MySQL
tables. Where do I find good PHP example scripts for MySQL table
manipulation.
As a beginning I want to try to make a simple page with some scrollable rows
from a MySQL table. For editing and adding records I need to make a page
with text entry fields and buttons to save the record into the table.
Thanks for hints if someone knows about freeware script snippets or examples
for this functionality.
regards
Geir
| |
| Colin McKinnon 2006-01-22, 7:02 pm |
| Geir Holmavatn wrote:
>
> I'm a newbie and I want to learn PHP
<snip>
> Thanks for hints if someone knows about freeware script snippets or
> examples for this functionality.
>
The best way to learn to program in any language is to write lots of code.
Certainly reading about the language and seeing other peoples code is
helpful, but you don't get a coherent picture from different short
tutorials published on the web. Perhaps somebody can recommend a good book.
The PHP manual is quite a good starting point - particularly if you read the
online version (with comments). http://www.hudzilla.org/phpbook/index.php
is OK too.
There are lots of places that publish code snippets which you can download
for free. However 90% of it is drivel, and starting from scratch you're not
a position to differentiate the good stuff. What makes it worse is that you
will probably invest your effort looking at smaller scripts in the hope of
better understanding them - the less capable programmer is only ever
capable of producing short scripts so your examplar codebase is skewed even
worse.
Avoid hotscripts.com. IMHO phpclasses.org is one of the better code download
sites (but even then....).
Do checkout ADOdb.sourceforge.net - and phplens.com for good DB abstraction
tools.
HTH
C.
| |
| Ken Chau 2006-01-23, 3:55 am |
| What you're asking for is a simple example. I know you're just starting
out with PHP, but maybe the best thing for you to realize early on is
that the MySQL calls have been properly abstracted thousands of times
by code that is supported by other people (as mentioned in a reply
above by Geir). For a beginner, maybe you should learn some syntax,
then play around with a good framework for application development.
This will give you a good sense of what is good development practice in
PHP, and maybe later on you can come up with your own frameworks.
http://www.phpontrax.com/ is an excellent framework based on Ruby on
Rails (which is a very awesome framework built on an amazing language).
Learn what it means to code model objects (more or less ... objects
that interact with a database tables).
But... in the end, you'll find good examples right on
http://www.php.net itself under their MySQL section.
|
|
|
|
|