We created a dataBase. Now we want to connect to it and show the results in a browser.
We use PHP for this. The examples show some possibilities of PHP.
http://www.nuggetkidd.byethost11.com/minorCourse/exampleInclude.php
We use a file to connect tot the dataBase, the connectionHeader.
We include this file in all the other files, so that when we have to change for example the password, we have to do this only once. And at the same time, the code in PHP is shorter, so it stays more clean.
http://www.nuggetkidd.byethost11.com/minorCourse/includeHeader.php
(if all is well, using "view source" in the browser will not reveal the password, because the PHP code is transformed into HTML. The nonsense you see at the end of the file is what we eventuallu need for a connection from FLASH to this database. With FLASH we can do nice animations and interactions.)
We connect to the database and ask for records, we get the records back and want to show the text and possible images in a nice list. For this we use a while loop.
http://www.nuggetkidd.byethost11.com/minorCourse/loadToFlash3.php
Then we will show also the images using PHP calling the images in a folder with the names of the images form the database. The fact that you have to insert "-things into a string which already needs "-things makes life a bit complicated.
You have to use \"-things before the "-things.....and this looks terrible!!!!!!
http://www.nuggetkidd.byethost11.com/minorCourse/loadToFlash4.php
Here are the PHP - files we used:
(of course the password in the connectionHeader.PHP has to be replaced by your own credentials.)
http://www.nuggetkidd.byethost11.com/minorCourse/php-database.zip
how to display an image in HTML, for example: http://www.fund-online.com/alabook/htmldemo/img2.htm
some PHP documentation, for example:http://php.net/manual/de/function.include.php
About FLASH AS3 scripting possibilities, connecting to media, database, AR and others. And now exploring Processing, starting datavisualisations
lundi 27 décembre 2010
dimanche 12 décembre 2010
making a DIY database
We will practice making a database, which we will need for another flash cs3 scripting miracle.
For this we need a browser, like Firefox, with a FTP plugin, FireFTP.
Then we need a host, like www.byethost.com/free-hosting
if we have an account, we go to the admin panel:
http://panel.byethost.com/
and we log in with our new account name and password.
Then we go to: php admin, and create a database.
We go to the MYSQL page and we can start making a table.
After making a table with fields, we start filling the fields and practice a bit inserting, deleting and searches.
Then we look at the MYSQL code and we copy this code and save it for later on.
The next step is looking a PHP pages.
With these pages we call the database and get the records.
First of all we will produce some "HTML" pages with the PHP pages, to get used to the coding.
The we will insert the MYSQL code into th PHP and look at the results.
My PHP examples can be found here:
http://www.contrechoc.com/crosslab/php-examples.zip
(The password has to be replaced.)
PHP references can be found everywhere:
http://www.w3schools.com/php/default.asp
also on this page PHP Database (on the left), this gives MYSQL code
http://www.w3schools.com/php/php_mysql_intro.asp
For this we need a browser, like Firefox, with a FTP plugin, FireFTP.
Then we need a host, like www.byethost.com/free-hosting
if we have an account, we go to the admin panel:
http://panel.byethost.com/
and we log in with our new account name and password.
Then we go to: php admin, and create a database.
We go to the MYSQL page and we can start making a table.
After making a table with fields, we start filling the fields and practice a bit inserting, deleting and searches.
Then we look at the MYSQL code and we copy this code and save it for later on.
The next step is looking a PHP pages.
With these pages we call the database and get the records.
First of all we will produce some "HTML" pages with the PHP pages, to get used to the coding.
The we will insert the MYSQL code into th PHP and look at the results.
My PHP examples can be found here:
http://www.contrechoc.com/crosslab/php-examples.zip
(The password has to be replaced.)
PHP references can be found everywhere:
http://www.w3schools.com/php/default.asp
also on this page PHP Database (on the left), this gives MYSQL code
http://www.w3schools.com/php/php_mysql_intro.asp
Inscription à :
Articles (Atom)
