Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
golfing products
programmershelp
finance products
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Your first mySQL example


Your first mySQL example

Creating the Database

In this first example we will create a MySQL database and then display the contents on the page.

First lets create the database , we will call this samplelinks . Start up MySQL and enter the following .

CREATE DATABASE samplelinks;
USE samplelinks;


Here is what is displayed on the screen.


Now we shall create our tablecalled links it will consist of the url and a brief description of the url , enter the following .

CREATE TABLE links(url VARCHAR(40) , description TEXT);

Here is what you should see.

Now lets add some values to the fields . Enter the following

INSERT INTO links VALUES('http://www.google.com' , ' The best search engine');
INSERT INTO links VALUES('http://www.beginnersphp.co.uk' , 'top notch php site');
INSERT INTO links VALUES('http://www.myscripting.com','Scripting resources galore here');

Here is what is displayed on the screen.

Now we will finally check that everything we have entered looks good . Enter the following to have a look at your links table.

SELECT * FROM links ;

Here is what should be displayed .

That is all we will be doing with our table ,of course you can add more links if you wish but this will do for our example.

In the next part we will show you how to connect to the MySQL database and display the links table on your web page.

Part 2




Books
 Sponsors
 Random Code
Status code of a web pagewith PHP and cURL(internet)
Display an Access database(database)
an example of a class in php(beginner)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials




beginners PHP Copyright © 2004 onwards by beginnersPHP.