Your Ad Here

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




 Sponsors
 Links
gambling sites
wwwstores
dropshippers
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 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
GD exists(image)
a simple class(beginner)
Show MySQL tables(database)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.