|
|
Php And Mysql Programming - anyone knows a code for mysql and php | ||
Discussion by catslic with 2 Replies.
Last Update: May 5, 2008, 9:49 am | |||
![]() |
|
|
hi everyone!
I am making a program using php and mysql...I am a noob on this so i need your help guys...I want to make a simple program that will some values and then store them on a database and then retrieve them...uhmm let me give an example out put of what i need.
This is the example say..: Enter First Name:
Enter Last Name:
Enter Age:
Enter Address:
..those are the data needed for input values...my question now is how can I make a database which will store the data of the inputed values and then retrieve them afterwards? I know there are lots of php and mysql gurus here which can help me...thanks guys in advance...
[note=rvalkass]
Moved from Making Money Online to PHP Programming.
[/note]
I am making a program using php and mysql...I am a noob on this so i need your help guys...I want to make a simple program that will some values and then store them on a database and then retrieve them...uhmm let me give an example out put of what i need.
This is the example say..: Enter First Name:
Enter Last Name:
Enter Age:
Enter Address:
..those are the data needed for input values...my question now is how can I make a database which will store the data of the inputed values and then retrieve them afterwards? I know there are lots of php and mysql gurus here which can help me...thanks guys in advance...
[note=rvalkass]
Moved from Making Money Online to PHP Programming.
[/note]
To create the database, I suggest making use of a tool such as phpMyAdmin. This will allow you to create the fields you need for your database to store your data. An example of the sort of table code I would use for this task is:
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`firstName` TEXT NOT NULL ,
`lastName` TEXT NOT NULL ,
`age` INT NOT NULL ,
`address` LONGTEXT NOT NULL
) ENGINE = InnoDB
Once your table is set up in your database, you will need to have some PHP code to connect to the database, to insert new rows, and to retrieve rows from the database. You will need the following basic code to connect to the MySQL database:
mysql_select_db('DATABASE NAME') or die('Could not select database');
Obviously, replace the bits in capital letters with your relevant information.
There is a basic example on the PHP website, along with a full function list. They will be useful to you.
Your PHP script will need to accept values from an HTML form, and INSERT them into the database. It will also need to SELECT the values in the database and display them to the user.
CODE
CREATE TABLE `addresses` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`firstName` TEXT NOT NULL ,
`lastName` TEXT NOT NULL ,
`age` INT NOT NULL ,
`address` LONGTEXT NOT NULL
) ENGINE = InnoDB
Once your table is set up in your database, you will need to have some PHP code to connect to the database, to insert new rows, and to retrieve rows from the database. You will need the following basic code to connect to the MySQL database:
CODE
$dbh = mysql_connect('localhost', 'MYSQL USERNAME', 'MYSQL PASSWORD') or die('Error: ' . mysql_error());mysql_select_db('DATABASE NAME') or die('Could not select database');
Obviously, replace the bits in capital letters with your relevant information.
There is a basic example on the PHP website, along with a full function list. They will be useful to you.
Your PHP script will need to accept values from an HTML form, and INSERT them into the database. It will also need to SELECT the values in the database and display them to the user.
thanks man! i appreciate your assistance...i'll let you know once i finished my program...i appreciate the infos 
Similar Topics:
Mysql Php Apache Downloads And Se...
Mysql, PHP, Apache downloads were easy enough. Then came the setup process. This seemed to be an endless mess of going back and forth trying to get the programs to work together properly. Finaly I got them working after about 48 hours. There are great tutorials on the setup process, but only one or ...more
Best Php And Mysql Editor For Noobs
Codelobster Php Edition
Php Preg Replace (1)
|
(11) "register.php" !The Interesting Point!
|
Loading...
HOME 





Pagination Tutorial for PHP MySQL Programmers - Web Intersect Paging Database Results
Dynamic Grid Output Programming Tutorial Using PHP + MySQL Array Data
2. MySQL PHP Search Programming : Build the HTML Search Form with Filter List

