MySQL Database using PHP
Here is what the form will look like just so you can check it for me (please)
code:
<form action="file.php" method="get"> Name<br> <input type="text" name="name"><br> Address<br> <input type="text" name="address1"><br> <input type="text" name="address2"><br> <input type="text" name="address3"><br> E-mail Address<br> <input type="text" name="email"><br> Phone Number<br> <input type="text" name="phone"><br> <input type="submit" value="Send"> </form>[/code]
The World of Dan posted this at 15:44 — 10th May 2000.
They have: 37 posts
Joined: Apr 2000
Hi guys, I need some help here, I'm totally new to PHP and MySQL, however i'm trying to develop a site based arround these two things.
I normally pick things up quite easily, but I need examples to work from.
Can someone please help me by telling me the code to do the following.
Lets say I want to create a database called info.???
The database will have the following fields in it:
name
address1
address2
address3
email
phone
The information will be sent to the service via a form on the site (which I can develop)
Can someone please give me an example of the code needed to do this.
Thanx
------------------
Dan
The World of Dan
Dan
The Eerie Network
Rob Pengelly posted this at 20:22 — 10th May 2000.
They have: 850 posts
Joined: Jul 1999
First you will need to create the database if you havent already. So you login through telnet, login to mysql and copy/paste
CREATE DATABASE databasename;
Than you will need to create the table where the input data will be stored.
CREATE TABLE peopleinfo(
ID INT(5) NOT NULL AUTO_INCREMENT,
Name VARCHAR(40),
Address1 VARCHAR(40),
Address2 VARCHAR(40),
Address3 VARCHAR(40),
Email VARCHAR(40),
Phone int(15),
PRIMARY KEY (ID)
);
Inside the scriptname.php3
have the following:
http://www.thehungersite.com - http://www.therainforestsite.com
http://www.ratemymullet.com - Beauty is only mullet deep.
The World of Dan posted this at 09:34 — 11th May 2000.
They have: 37 posts
Joined: Apr 2000
This is cool, but I have a slight problem, I don't have telnet access, I think I might be able to get it, but i'd prefer to do it another way if it's possable.
Any suggestions??
------------------
Dan
The World of Dan
Dan
The Eerie Network
The World of Dan posted this at 10:39 — 11th May 2000.
They have: 37 posts
Joined: Apr 2000
What would the databases file extention be?
anti posted this at 18:03 — 11th May 2000.
They have: 453 posts
Joined: Jan 1999
Hi,
developing scripts without telnet/ssh access is very painfull and inefficient.
If your hosting company doesn't provide it, use another one.
You can use phpMysqlAdmin to create the database.
Since you are using a RDBMS (mysql) you don't have to care about the file extension.
btw:
The php and mysql homepages both have links to very good tutorials for this, including examples.
I just started using PHP today, but my mySQL+PHP user-manager already works ...
ciao
Anti
The World of Dan posted this at 09:29 — 12th May 2000.
They have: 37 posts
Joined: Apr 2000
I can get SHH (secure telnet access I think) but I need to provide an IP address, and my ISP dynamaticly assigns them
I have got the phpmysqladmin thing, it's just been installed on my server, so I'll have a mess about with that and see what happens
Thanx.
------------------
Dan
The World of Dan
Dan
The Eerie Network
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.