Help - Search - Member List - Calendar
Full Version: PHP and MYSQL
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Christo
ok i know some basic php

I have done a bit of C++ and it seems very similar, basically what i want
is, someone or somewhere on the net that will give me a very clear guide to
the ways which i can take the contents of a form and then add those contents
into a database (mysql)

also how to construct the database (i have phpmyadmin) i really only want 4
fields in the database they are listed below...

Number
Name
Email Address
Location

and i just want to create a form interface that will add the contents of the
form into the database, for example

Name
Email Address
Location

I want the number to be incremented automatically in the database, so for
example say John Smith was to enter his information

John Smith
[Email Removed]
England

his number (John Smith) would be 0001

then if Joe bloggs was to enter his details

Joe Bloggs
[Email Removed]
USA

joe bloggs number would be 0002

I want to then display these entries on a page, displaying them like this

0001 John Smith [Email Removed] England
0002 Joe Bloggs [Email Removed] USA

I would really prefer only displaying about 250 entries per page, so say
there was 500 entries in the database, then I would prefer a button at the
bottom of the first page of 250 names etc that gives the user the option to
go to page 2, or links along the top

<< 1 | 2 | 3 | 4 >>

if you know what i mean.

does this system sound hard to create? I am a bit of a novice with PHP and
would appreciate any help i can get at all, I know the basics of programming
so I should be fine grasping any new concepts, its just getting the stuff
from the form into the database then from the database onto a page/pages

I must emphasize the need for splitting the list up into pages, I am
expecting at least 4000 entries, and having this amount on one page would be
crazy!

Thanks In Advance


--

Christo

Tony
Christo wrote:
QUOTE
ok i know some basic php

I have done a bit of C++ and it seems very similar, basically what i
want is, someone or somewhere on the net that will give me a very
clear guide to the ways which i can take the contents of a form and
then add those contents into a database (mysql)

How familiar are you with SQL in general?

If you know 'some basic php', as you say, then getting the data from a form
should be no problem. You will need to be able to create SQL queries to put
the data into the database. I believe MySQL has a tutorial on their website,
or check out w3schools.com

Once you have some grasp of that, then refer to the PHP manual on MySQL
functions at http://us3.php.net/manual/en/ref.mysql.php

Of particular note will be mysql_connect, mysql_select_db, and mysql_query.

The x number of entries per page is relatively easy, especially if you use
LIMIT in your SQL query - but concentrate on getting the input & output
first, then work on the formatting.

--
Tony Garcia
http://www.dslextreme.com/~tony23/

Christo
"Tony" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE
Christo wrote:
ok i know some basic php

I have done a bit of C++ and it seems very similar, basically what i
want is, someone or somewhere on the net that will give me a very
clear guide to the ways which i can take the contents of a form and
then add those contents into a database (mysql)

How familiar are you with SQL in general?

If you know 'some basic php', as you say, then getting the data from a
form should be no problem. You will need to be able to create SQL queries
to put the data into the database. I believe MySQL has a tutorial on their
website, or check out w3schools.com

Once you have some grasp of that, then refer to the PHP manual on MySQL
functions at http://us3.php.net/manual/en/ref.mysql.php

Of particular note will be mysql_connect, mysql_select_db, and
mysql_query.

The x number of entries per page is relatively easy, especially if you use
LIMIT in your SQL query - but concentrate on getting the input & output
first, then work on the formatting.

--
Tony Garcia
http://www.dslextreme.com/~tony23/



Thanks, it looks like I am going to have to get to know SQL before i begin
this, I will have a read on the web and perhaps pop down to the library, see
if they have any books on it.

Thanks for the advice, I know where to look now, cheers.

Christo

Dan M
QUOTE
Thanks, it looks like I am going to have to get to know SQL before i begin
this, I will have a read on the web and perhaps pop down to the library, see
if they have any books on it.

Thanks for the advice, I know where to look now, cheers.

w3schools.com also has a good tutorial on SQL. I highly recommend them.

Dan M
QUOTE
I want the number to be incremented automatically in the database, so for
example say John Smith was to enter his information

This requirement is simple - define the field as "AUTOINCREMENT".

QUOTE
I would really prefer only displaying about 250 entries per page, so say
there was 500 entries in the database, then I would prefer a button at the
bottom of the first page of 250 names etc that gives the user the option to
go to page 2, or links along the top

This can be handled using MySQL's "LIMIT" clause.

QUOTE
does this system sound hard to create? I am a bit of a novice with PHP and
would appreciate any help i can get at all, I know the basics of programming
so I should be fine grasping any new concepts, its just getting the stuff
from the form into the database then from the database onto a page/pages

No, it actually sounds pretty easy. I'm a newcomer to PHP myself (I'm
making the transition to PHP after programming Perl for several years)
but fairly experienced with MySQL. Your description of this project
sounds pretty straightforwardd.

Ian Hobson
The book below tells you all you need to know.

http://www.amazon.co.uk/exec/obidos/ASIN/

It covers PHP and SQL in enough depth for what you need, and more.

Regards

Ian

In message <d8c4jp$rti$[Email Removed]>, Christo
<lessthanchris666no@span.?.com.invalid> writes
QUOTE
ok i know some basic php

Snip sketch of simple database app.


--
Ian - posting to a Newsgroup. Please remove everything to reply.

Domestos
Christo -

I started from scratch at the begining of this week...

I used the text-book called

'PHP and MySQL Web Development'
ISBN : 0-672-32525-X

Amazon :
'http://www.amazon.com/exec/obidos/ASIN/067232525X/qid%3D1118791498/sr%3D11-
1/ref%3Dsr%5F11%5F1/-0864000'

(watch the wrap round

there is a tutorial in chapter 24 that gives you the code you need to do
exaclty want you want.

I knew nothing about php, mysql but am quite a decent coder in HTML. i;m
taking my next steps and the people on these forums are more than generous
with thier time.

Have fun...


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.