AuthoradminReading 3 minViews419Published byModified by
Welcome to our first video tutorial. Where I’m going to show you in detail how to setup a local web development environment. This tutorial is for novices and beginner in web development. Most of us are using Windows systems, this is because I selected WAMP at the most appropriate tool for us. We will install WAMP at our computer, and I will show you how you can use your database (phpMyAdmin), and, as some extra – I will show you a process of making own php-based RSS feed (on PHP).
After you have finished this video, you can copy and test the code we have just made:
01
<?
02
// step 1 - we should connect to database and take all our records:
03
$vLink= mysql_connect('localhost', 'root', ''); // this is default username and password for WAMP
04
mysql_select_db('test_db', $vLink);
05
mysql_query('SET names UTF8'); // let's set UTF8 mode (in order to support unicode)
06
$sSQL= 'SELECT * FROM `stories` ORDER BY `id` DESC'; // this is our SQL query to take our records
07
$vRes= mysql_query($sSQL); // execution of query
08
$aStories= array(); // an empty array to collect stories (records)
09
if($vRes) {
10
while($aRow= mysql_fetch_array($vRes, MYSQL_ASSOC)) { // lets walk through all the records
11
$aStories[] = $aRow;
12
}
13
mysql_free_result($vRes);
14
}
15
// check
16
// print_r($aStories); // well done
17
// step 2 - display data array as rss feed
18
$sFeeds= '';
19
foreach($aStoriesas$aStory) { // let's walk through all the records again and prepare Items for RSS