<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-13407829</id><updated>2009-10-17T18:03:02.572+07:00</updated><title type='text'>Information Technology</title><subtitle type='html'>We can't do something if we only "want do something", with firm that we have to do something, so will become the big strength for us for do something.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-13407829.post-3933740998721758260</id><published>2008-07-08T20:35:00.006+07:00</published><updated>2008-07-08T21:01:23.890+07:00</updated><title type='text'>Ms Access : Creating Database Tables</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Option 1: Programatically&lt;/span&gt; &lt;p&gt;The following is an example of creating a new table. Note that we are specifying the name of the table, the name of each column, and the data type of each column. More parameters can be added to this example if your requirements are more specific.&lt;/p&gt; &lt;div class="example-code"&gt; &lt;code&gt; &lt;/code&gt;&lt;pre&gt;CREATE TABLE Individual&lt;br /&gt;(IndividualId int,&lt;br /&gt;FirstName Varchar(255),&lt;br /&gt;LastName Varchar(255),&lt;br /&gt;DateCreated dateTime&lt;br /&gt;)&lt;br /&gt;&lt;/pre&gt;  &lt;/div&gt;  &lt;h2 style="font-weight: bold;"&gt;&lt;span style="font-size:100%;"&gt;Option 2: User Interface&lt;/span&gt;&lt;/h2&gt; &lt;p&gt;Database management systems usually have a "Design View" for creating tables. Design view enables you to create the names of each column, specify the type of data that can go into each column, as well as specifying any other restrictions you'd like to enforce. Restricting the data type for each column is very important and helps maintain &lt;i&gt;data integrity&lt;/i&gt;. For example, it can prevent us from accidentally entering an email address into a field for storing the current date.&lt;/p&gt; &lt;p&gt;More parameters can be added against each column if you require them. For example, you could specify a default value to be used (in case the field has been left blank by the user).&lt;/p&gt; &lt;p&gt;When you create a table via the user interface (or design view), depending on which database system you use, you should see something like this:&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_MHwlIcvvQgk/SHNuYpmsG3I/AAAAAAAAAB4/fhO8l65284Q/s1600-h/untitled.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp3.blogger.com/_MHwlIcvvQgk/SHNuYpmsG3I/AAAAAAAAAB4/fhO8l65284Q/s320/untitled.JPG" alt="" id="BLOGGER_PHOTO_ID_5220637762816580466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Once you've created your table in "design view", you can switch to "datasheet view" to see the resulting table. You should see something like this:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_MHwlIcvvQgk/SHNvVxPbEQI/AAAAAAAAACA/Hg8cns6txRw/s1600-h/untitled2.JPG"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://bp3.blogger.com/_MHwlIcvvQgk/SHNvVxPbEQI/AAAAAAAAACA/Hg8cns6txRw/s320/untitled2.JPG" alt="" id="BLOGGER_PHOTO_ID_5220638812838498562" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;OK, so this is a blank table - it doesn't have any data yet. What we have is a table that contains the columns required before we can enter any data.&lt;/p&gt; &lt;p&gt;So, now that we have a blank table, let's look at how to add data.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-3933740998721758260?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.quackit.com/database/tutorial/creating_database_tables.cfm' title='Ms Access : Creating Database Tables'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/3933740998721758260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=3933740998721758260&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3933740998721758260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3933740998721758260'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/ms-access-creating-database-tables.html' title='Ms Access : Creating Database Tables'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_MHwlIcvvQgk/SHNuYpmsG3I/AAAAAAAAAB4/fhO8l65284Q/s72-c/untitled.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-8555064411298605396</id><published>2008-07-02T01:15:00.005+07:00</published><updated>2008-07-02T01:20:15.653+07:00</updated><title type='text'>Ms Access : About Database Tables</title><content type='html'>Database tables will most likely be the area you'll become most familiar with after working with databases for a while. Now, before we go ahead and start adding tables to our new database, let's have a look at what a database table actually is.&lt;br /&gt;What is a Table?&lt;br /&gt;&lt;br /&gt;In database terms, a table is responsible for storing data in the database. Database tables consist of rows and columns.&lt;br /&gt;&lt;br /&gt;In the following example, the second row is highlighted in black:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_MHwlIcvvQgk/SGp0xytq0aI/AAAAAAAAABk/19wYAkrTOkw/s320/untitled7.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218111517037875618" /&gt;&lt;br /&gt;&lt;br /&gt;In the next example, the second column is highlighted in black. This column has been given a name of "FirstName":&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_MHwlIcvvQgk/SGp1Eqbu5SI/AAAAAAAAABs/S4uFLcBjXZ8/s320/untitled8.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218111841232676130" /&gt;&lt;br /&gt;&lt;br /&gt;A row contains each record in the table, and the column is responsible for defining the type of data that goes into each cell. Therefore, if we need to add a new person to our table, we would create a new row with the person's details.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-8555064411298605396?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.quackit.com/database/tutorial/about_database_tables.cfm' title='Ms Access : About Database Tables'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/8555064411298605396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=8555064411298605396&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8555064411298605396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8555064411298605396'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/ms-access-about-database-tables.html' title='Ms Access : About Database Tables'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_MHwlIcvvQgk/SGp0xytq0aI/AAAAAAAAABk/19wYAkrTOkw/s72-c/untitled7.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-1952405832298126429</id><published>2008-07-02T01:04:00.007+07:00</published><updated>2008-07-02T01:14:18.845+07:00</updated><title type='text'>Ms Access : Creating a Database</title><content type='html'>With database management systems, many tasks can be done either via programatically or a user interface. Creating databases is no exception.&lt;br /&gt;Option 1: Programatically&lt;br /&gt;&lt;br /&gt;Many database administrators (DBAs) use Structured Query Language (SQL) to perform many of their database tasks. To enter SQL, you need to open an interface that allows you to enter your code. For example, if you use SQL Server, you would normally use Query Analyzer.&lt;br /&gt;&lt;br /&gt;The following example is the basic code for creating a new database. Parameters can be added to this example if your requirements are more specific.&lt;br /&gt;CREATE DATABASE MyDatabase&lt;br /&gt;&lt;br /&gt;Note: This example assumes you know how to use your database system to run scripts like this. If you don't you, will probably find it easier to use the user interface method (below).&lt;br /&gt;Option 2: User Interface&lt;br /&gt;&lt;br /&gt;Most database systems make it very easy to create a database via a user interface. Generally, it's just a matter of selecting an option from a menu, then providing a name for your database.&lt;br /&gt;&lt;br /&gt;The following examples demonstrate how to create a database in Microsoft Access.&lt;br /&gt;From the "File" menu, click on "New Database":&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp3.blogger.com/_MHwlIcvvQgk/SGpy_yRAZkI/AAAAAAAAABE/RR4XxcdQo1w/s320/untitled3.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218109558412568130" /&gt;&lt;br /&gt;&lt;br /&gt;Choose "Blank Database". (MS Access also gives you the ability to choose from a template, but we'll just use a blank database here):&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_MHwlIcvvQgk/SGpzPWSlviI/AAAAAAAAABM/Kv_z351fMLo/s320/untitled4.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218109825780923938" /&gt;&lt;br /&gt;&lt;br /&gt;Choose a location to save the database:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_MHwlIcvvQgk/SGpzdwIvXHI/AAAAAAAAABU/V8DPDmwqJXs/s320/untitled5.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218110073237101682" /&gt;&lt;br /&gt;&lt;br /&gt;Your New Database&lt;br /&gt;Once you've completed the above tasks, you should see a blank database, like this:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp2.blogger.com/_MHwlIcvvQgk/SGpzs1IjQDI/AAAAAAAAABc/j2igRxFwf-0/s320/untitled6.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218110332276523058" /&gt;&lt;br /&gt;&lt;br /&gt;We know this database is blank because it doesn't have any tables. If it did, you would see these tables in the middle pane of the table tab. Now that we have our blank database, we can start adding some tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-1952405832298126429?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.quackit.com/database/tutorial/creating_a_database.cfm' title='Ms Access : Creating a Database'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/1952405832298126429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=1952405832298126429&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/1952405832298126429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/1952405832298126429'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/ms-access-creating-database.html' title='Ms Access : Creating a Database'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_MHwlIcvvQgk/SGpy_yRAZkI/AAAAAAAAABE/RR4XxcdQo1w/s72-c/untitled3.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-4719744638967166633</id><published>2008-07-02T00:52:00.006+07:00</published><updated>2008-07-02T00:58:24.745+07:00</updated><title type='text'>MySql : Manage Data</title><content type='html'>Once we have collected data in the database the links may get old and need updating or the links just may no longer work. So we need to be able to update and/or delete the data from the database.&lt;br /&gt;&lt;br /&gt;There are two SQL statements which handle each of these, and they are coincidently named UPDATE and DELETE.&lt;br /&gt;&lt;br /&gt;The format for the UPDATE statment is:&lt;br /&gt;UPDATE (table) SET&lt;br /&gt;(column1) = (value),&lt;br /&gt;(column2) = (value),&lt;br /&gt;...&lt;br /&gt;WHERE (column) = (value)&lt;br /&gt;The last column = value line does not have a comma after it. Also it is very important to use the WHERE clause to specify which data record you want to update. If the where clause is left out it will update all records with the specified values. This is where the primary key id becomes useful, the unique primary key is used to specify which record you want to update.&lt;br /&gt;&lt;br /&gt;The DELETE statement format is:&lt;br /&gt;DELETE FROM (table)&lt;br /&gt;WHERE (column) = (value)&lt;br /&gt;This will delete the complete record(s), multiple rows can be delete at once depending on the WHERE clause. Again the WHERE clause is crucial, if it is left off it will delete all records from the database.&lt;br /&gt;&lt;br /&gt;A good example of how to manage links is at any of the portal personal pages, such as my.excite.com, or my.yahoo.com. These sites display the links entered in, and you then click to edit or delete the one you want. To do this you first need to use a SELECT statment to display the available links. The code is the same as before:&lt;br /&gt;&lt;?&lt;br /&gt;$category = "Local Docs";&lt;br /&gt;&lt;br /&gt;$SQL = " SELECT * FROM links ";&lt;br /&gt;$SQL = $SQL . " WHERE category = '$category' ";&lt;br /&gt;$retid = mysql_db_query($db, $SQL, $cid);&lt;br /&gt;if (!$retid) { echo( mysql_error()); }&lt;br /&gt;?&gt;&lt;br /&gt;One difference is displaying the links. We do not need the links "live" but instead want to be able to edit them by clicking either "edit" or "delete". We will need the primary key id of the link we wish to edit or delete. The primary key can be passed in via the URL and the get method by adding on ?id=(number) at the end of the URL.&lt;br /&gt;&lt;br /&gt;The delete code is shown below, I will leave the edit page as an exercise for you to do. The edit page is only slightly more complex because you need another form to display the data to edit. This can be processed the same way as the insert script. What I usually do is copy over the insert form and modify that, it is a good base for my edit page.&lt;br /&gt;&lt;br /&gt;Code to display the links on the screen:&lt;br /&gt;&lt;?&lt;br /&gt;echo ("&lt;p&gt;&lt;table&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;b&gt;$category&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;\n");&lt;br /&gt;while ($row = mysql_fetch_array($retid)) {&lt;br /&gt;$sitename = $row["sitename"];&lt;br /&gt;$id = $row["id"];&lt;br /&gt;&lt;br /&gt;echo ("&lt;tr&gt;");&lt;br /&gt;echo ("&lt;td&gt;$sitename&lt;/td&gt;\n");&lt;br /&gt;echo ("&lt;td&gt;&lt;a href="\" id="$id\"&gt;Edit&lt;/a&gt;&lt;/td&gt;");&lt;br /&gt;echo ("&lt;td&gt;&lt;a href="\" id="$id&amp;amp;task="del\"&gt;Delete&lt;/a&gt;&lt;/td&gt;");&lt;br /&gt;echo ("&lt;/tr&gt;");&lt;br /&gt;}&lt;br /&gt;echo ("&lt;/table&gt;");&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;When the "Edit" link is clicked it will go to the "manageedit.php" page, it will also pass along the id of the link to edit. This page will display the data in a form, when that form is submitted it will update the information.&lt;br /&gt;&lt;br /&gt;When the "Delete" link is clicked it will submit to the same page (manage.php) and pass along two variables. The first variable is the id of the record to delete, the second variable is "task" which is set to "del". This is done so we can catch that variable and know we are performing a delete action when we load the page. The following code, which is placed in the top of the script, shows how:&lt;br /&gt;if ($task=="del") {&lt;br /&gt;&lt;br /&gt;$SQL = " DELETE FROM links ";&lt;br /&gt;$SQL = $SQL . " WHERE id = $id ";&lt;br /&gt;mysql_db_query($db, $SQL, $cid);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-4719744638967166633?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blazonry.com/scripting/linksdb/manage_data.php' title='MySql : Manage Data'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/4719744638967166633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=4719744638967166633&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/4719744638967166633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/4719744638967166633'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/mysql-manage-data.html' title='MySql : Manage Data'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-4102219311972491802</id><published>2008-07-02T00:50:00.002+07:00</published><updated>2008-07-02T00:51:57.720+07:00</updated><title type='text'>MySql : View Data from Database</title><content type='html'>Now we want to retrieve the data from the database and display them as links on the page. The SQL statement used to get data from a database is SELECT. The format is:&lt;br /&gt;SELECT (columns) FROM (table)&lt;br /&gt;WHERE (exclusive criteria)&lt;br /&gt;&lt;br /&gt;For our database we want so select all columns, so a '*' is used instead of listing out each column. We also only want to select a specific category of links, let's say "Local Docs" is the cateogry we want. So our SELECT SQL statement would be:&lt;br /&gt;SELECT * FROM links&lt;br /&gt;WHERE category = 'Local Docs'&lt;br /&gt;&lt;br /&gt;Single quotes specify a string value in the WHERE clause, if we were using a column which was a number value no quotes would be needed. The WHERE part is optional, if you want to select everything from the database you can leave off the WHERE portion. Review the SQL Tutorial for more examples of what can be done with SELECT statements and WHERE clauses.&lt;br /&gt;&lt;br /&gt;The script to display links out of the database starts with the usually code to initialize the database connection.&lt;br /&gt;$usr = "--username--";&lt;br /&gt;$pwd = "--password--";&lt;br /&gt;$db = "linksdb";&lt;br /&gt;$host = "localhost";&lt;br /&gt;&lt;br /&gt;$cid = mysql_connect($host,$usr,$pwd);&lt;br /&gt;if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;The next part of the script is setting up and executing the SQL statement. This should look familiar to the previous pages. I set the category as a variable at the beginning so the code can be copied and pasted for other category selects and only one change is needed.&lt;br /&gt;$category = "Local Docs";&lt;br /&gt;&lt;br /&gt;$SQL = " SELECT * FROM links ";&lt;br /&gt;$SQL = $SQL . " WHERE category = '$category' ";&lt;br /&gt;$retid = mysql_db_query($db, $SQL, $cid);&lt;br /&gt;if (!$retid) { echo( mysql_error()); }&lt;br /&gt;&lt;br /&gt;The SELECT statement returns rows of data from the database. We need to loop through that data and display the information we want, which will be our links. The command to grab a row is:&lt;br /&gt;$row = mysql_fetch_array($retid);&lt;br /&gt;&lt;br /&gt;This sets $row as an array holding one record from the database, with the column names as the "keys" for the array. So to retrieve the siteurl value from that array you would use:&lt;br /&gt;$siteurl = $row["siteurl"];&lt;br /&gt;&lt;br /&gt;When the mysql_fetch_array command is called next, it moves to the next data record returned by the SELECT. If there are no more rows of data the command returns false. So to loop through all rows of data we can setup a while statement with the mysql_fetch_array in it. So here is the code to loop through the data and display it to the screen:&lt;br /&gt;while ($row = mysql_fetch_array($retid)) {&lt;br /&gt;$siteurl = $row["siteurl"];&lt;br /&gt;$sitename = $row["sitename"];&lt;br /&gt;&lt;br /&gt;echo ("&lt;br /&gt;$sitename&lt;br /&gt;\n");&lt;br /&gt;}&lt;br /&gt;echo ("");&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;You can download the complete script of viewing data from clik the title of this posting&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-4102219311972491802?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blazonry.com/scripting/linksdb/view_data.php' title='MySql : View Data from Database'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/4102219311972491802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=4102219311972491802&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/4102219311972491802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/4102219311972491802'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/mysql-view-data-from-database.html' title='MySql : View Data from Database'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-1490457138597973662</id><published>2008-07-02T00:40:00.005+07:00</published><updated>2008-07-02T00:50:31.704+07:00</updated><title type='text'>MySql : Insert Data</title><content type='html'>We need to get some data into the database. To do so we use an HTML form to collect the data, and then insert it into the database using PHP. Both these functions can be done on the same page.&lt;br /&gt;&lt;br /&gt;The form can submit to the same page it is on. This page checks if the POST method is used. If so, insert into the database. I find it easier to have the form and database insert operation on the same page. Makes one less file to keep track of.&lt;br /&gt;&lt;br /&gt;Here is the HTML for the form:&lt;br /&gt;&lt;br /&gt;&lt;form name="fa" action="http://www.blogger.com/insert_link.php" method="post"&gt;&lt;form name="fa" action="http://www.blogger.com/insert_link.php" method="post"&gt;&lt;form name="fa" action="insert_link.php" method="POST"&gt;&lt;br /&gt;&lt;b&gt;Category: &lt;/b&gt; &lt;input type="text" name="category" size="40"&gt;&lt;br /&gt;&lt;b&gt;Site Name:&lt;/b&gt; &lt;input type="text" name="sitename" size="40"&gt;&lt;br /&gt;&lt;b&gt;Site URL: &lt;/b&gt; &lt;input type="text" name="siteurl" value="http://" size="40"&gt;&lt;br /&gt;&lt;b&gt;Description: &lt;/b&gt; &lt;textarea name="description" rows="5" cols="40"&gt;&lt;/textarea&gt;&lt;br /&gt;&lt;p&gt;&lt;input type="submit" value="Add Link"&gt;&lt;/p&gt;&lt;br /&gt;&lt;/form&gt;&lt;br /&gt;&lt;/form&gt;&lt;/form&gt;&lt;br /&gt;The above HTML snippet has the table elements removed because they are for display purpose only. The HTML for the form below is displayed using a table.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp1.blogger.com/_MHwlIcvvQgk/SGptVtYbaKI/AAAAAAAAAA0/SMoMdDvtisE/s320/untitled2.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218103337988876450" /&gt;&lt;br /&gt;&lt;br /&gt;This form gathers the information we want to insert into the database and submits back to the same page it is on. We now need the PHP code to process this information. The first block of code is setting up the connection to the database. This is the same as used on the create table page.&lt;br /&gt;&lt;br /&gt;This form gathers the information we want to insert into the database and submits back to the same page it is on. We now need the PHP code to process this information. The first block of code is setting up the connection to the database. This is the same as used on the create table page.&lt;br /&gt;&lt;br /&gt;?&gt;?&gt;?&gt;&lt;br /&gt;&lt;br /&gt;The second part is run only when the request method on the page is a POST. This is when the form is submitted back to the page. We need to create our SQL statement for the insert. The SQL format for an INSERT is:&lt;br /&gt;INSERT INTO -tablename-&lt;br /&gt;(column_name1, column_name2, ...) VALUES&lt;br /&gt;(data1, data2, ... )&lt;br /&gt;&lt;br /&gt;Where the first column name matches to the first data in each of the sets. Remember PHP variables are automatically initialized with the form field names submitted to the page. So the PHP code to submit the query and check for errors is:&lt;br /&gt;?&gt;?&gt;?&gt;&lt;br /&gt;&lt;br /&gt;Escaping Data&lt;br /&gt;When creating SQL statements, string values are delimited using apostrophes (see above code). So what happens when there is an apostrophe in the data you are trying to insert? A SQL error will occur if, for example, the description variable included an apostrophe. Because you do not know what the user will type in, you must assume they are entering all sorts of bad data.&lt;br /&gt;&lt;br /&gt;To insert an apostrophe into the database using SQL you need to "double-up" the apostrophes. That is, put two apostrophes in the text where you want just one. For example, to insert the phrase "what's up?" into a database, the SQL code looks like:&lt;br /&gt;INSERT INTO mytable (phrases) VALUES ('what''s up?')&lt;br /&gt;&lt;br /&gt;In PHP there is a string function which allows you to do just this on variables quite easily: str_replace This function replaces one value with another in a string. So before you insert data in the database you should replace all single apostrophes with double-apostrophes. For the example variable, the PHP code is:&lt;br /&gt;$description = str_replace("'","''",$description);&lt;br /&gt;&lt;br /&gt;Note: This does not insert two apostrophes into the database, just one. So when you pull the data out of the database, it will contain only single apostrophes.&lt;br /&gt;&lt;br /&gt;For complte script clik the title of posting&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-1490457138597973662?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blazonry.com/scripting/linksdb/insert_data.php' title='MySql : Insert Data'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/1490457138597973662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=1490457138597973662&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/1490457138597973662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/1490457138597973662'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/mysql-insert-data.html' title='MySql : Insert Data'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_MHwlIcvvQgk/SGptVtYbaKI/AAAAAAAAAA0/SMoMdDvtisE/s72-c/untitled2.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-8055805000761617929</id><published>2008-07-02T00:38:00.002+07:00</published><updated>2008-07-02T00:39:54.185+07:00</updated><title type='text'>MySql : Create Database</title><content type='html'>We know what data we want and what we want to with that data. Now we need to create the database to store the data. The first thing to do is create an empty database to hold our table. For this tutorial, I name the database  linksdb. In MySQL you use the following command from the command line to create the new database.&lt;br /&gt;&lt;br /&gt;mysqladmin -p create linksdb&lt;br /&gt;&lt;br /&gt;The "-p" flag is used so it will prompt you for your password to MySQL. Most setups require a username and password. Read the MySQL doumentation on how to setup the username and password using the mysqladmin tool. It is fairly straight forward, however you may need root access.&lt;br /&gt;&lt;br /&gt;Test connecting to the database using the mysql client. On the command line:&lt;br /&gt;&lt;br /&gt;mysql -p linksdb&lt;br /&gt;&lt;br /&gt;You should get a mysql&gt; prompt if it connects to the database. Else, it returns an error saying Unknown database 'linksdb'&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Creating the Database Table&lt;br /&gt;Next we need to create the table in the database. Tables are created using SQL statements, and can be created using the mysql client tool or PHP. The nice thing about using a PHP script to create the table is you can save the script to use later. If something goes wrong, you can recreate the tables. Or, you can use it to refer to the database schema.&lt;br /&gt;&lt;br /&gt;The SQL command to create a table is:&lt;br /&gt;CREATE TABLE  tablename (&lt;br /&gt;column1 column1type,&lt;br /&gt;column2 column2type,&lt;br /&gt;etc.... )&lt;br /&gt;&lt;br /&gt;The table we want to create is:&lt;br /&gt;Table Name: links&lt;br /&gt;&lt;br /&gt;Columns:    id           (integer - primary link key)&lt;br /&gt;&lt;br /&gt;        sitename     (50 characters)&lt;br /&gt;&lt;br /&gt;        siteurl      (75 characters)&lt;br /&gt;&lt;br /&gt;        description  (text field - lots of text)&lt;br /&gt;&lt;br /&gt;        category     (50 characters)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So the SQL code to create the categories table is:&lt;br /&gt;CREATE TABLE links (&lt;br /&gt;id INT NOT NULL AUTO_INCREMENT,&lt;br /&gt;sitename VARCHAR(50),&lt;br /&gt;siteurl VARCHAR(75),&lt;br /&gt;description TEXT,&lt;br /&gt;category VARCHAR(50),&lt;br /&gt;PRIMARY KEY(id) );&lt;br /&gt;&lt;br /&gt;The  id column is the primary key for this table. In order to be a primary key the column can not be null (NOT NULL). I also set it to automatically increment the number (AUTO_INCREMENT) so when each record is added the id will increase by one. The last line specifies that the id column will be the primary key for this table. A primary key is a unique number for that specific record or row of data.&lt;br /&gt;&lt;br /&gt;The  sitename,  siteurl, and  category column each are specifed as a VARCHAR or variable character field each with their respective maximum length. A VARCHAR field holds characters from 0 up to its maximum specified length. Most databases VARCHAR limit is 255 characters. If you have a field which may require more characters you should use a TEXT field, which is what is used for the  description field. A text field can hold  lots of data, usually dependent on the database.&lt;br /&gt;&lt;br /&gt;The most common data types are INT, VARCHAR, TEXT and DATETIME.  Look in the MySQL documentation about creating databases for information about other available datatypes in MySQL, and more specifics the data types it supports.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Executing SQL in PHP&lt;br /&gt;The code to execute a SQL statement in PHP has 3 steps:&lt;br /&gt;Connect to database&lt;br /&gt;Create statement&lt;br /&gt;Execute statement&lt;br /&gt;&lt;br /&gt;1.The command to connect to the database is:&lt;br /&gt;&lt;br /&gt;$cid = mysql_connect($host,$usr,$pwd);&lt;br /&gt;&lt;br /&gt;Where $host, $usr, and $pwd are previously specified. Host refers to the machine running MySQL and the username and password to connect to that MySQL machine. This command returns a connection id, which is used for to identify this connection in later queries.&lt;br /&gt;&lt;br /&gt;2.Creating the SQL statement simply consists of assigning the SQL statement such as the one above to a string. I usually have it run over multiple lines concatanating the string together as I go, this makes it easier to read.&lt;br /&gt;&lt;br /&gt;3.The command to actual send the database the SQL command is:&lt;br /&gt;&lt;br /&gt;$result = mysql_db_query($db,"$SQL",$cid);&lt;br /&gt;&lt;br /&gt;Where $db is the database to query, $SQL is the SQL statement, and $cid is the connection id created above. This returns a 1 if executed correctly, and undefined or false if an error occurred.&lt;br /&gt;&lt;br /&gt;Putting all of this together, and adding a little error detection and displaying of the errors gives us the following script, which you can download and load on to your web server running PHP. Note: Opening the file through the web server will execute the script and create the database tables.&lt;br /&gt;&lt;br /&gt;Download:  PHP Script to create tables (create_table.phps)&lt;br /&gt;Note: You must edit the username and password at the top of this script to reflect your system.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Problems: The most common problem when running this script is connecting to the database. Make sure you replace the username and password variables with your username and password setup to connect to your MySQL server. You can trouble shoot connection problems using the  mysql client from the shell, use mysql -? for help.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-8055805000761617929?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blazonry.com/scripting/linksdb/create_table.php' title='MySql : Create Database'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/8055805000761617929/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=8055805000761617929&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8055805000761617929'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8055805000761617929'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/mysql-create-database.html' title='MySql : Create Database'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-3434918805652892536</id><published>2008-07-02T00:37:00.003+07:00</published><updated>2008-07-02T00:38:19.975+07:00</updated><title type='text'>MySql : Getting Started</title><content type='html'>Getting started with a database means first figuring out what you want to do. Our sample project in this tutorial is building a database which manages links to sites. I want to be able to add, edit and remove links in the database, as well as display links from the database. I want the links to be categorized so I can display groups of links, instead of all links at once.&lt;br /&gt;&lt;br /&gt;I want to record the following data for each link in the database:&lt;br /&gt;Name of site&lt;br /&gt;URL of site&lt;br /&gt;Description of site&lt;br /&gt;Link Category&lt;br /&gt;&lt;br /&gt;Each of these will become one column in a table in the database. If you are not familiar with databases, a table can be thought of somewhat as a spreadsheet in Excel. The columns in a spreadsheet relate to the columns in a database. Each row in the spreadsheet would be considered a record (or row) in the database. There also can be multiple spreadsheets in a single Excel file, as there can be multiple tables in one database.&lt;br /&gt;&lt;br /&gt;This application could use two tables, one table to store all of the categories and another table to store all the links, with a link back to the categories table. Because this is a beginner tutorial, I keep it simple by using just one table to store the info.&lt;br /&gt;&lt;br /&gt;Advanced Topic&lt;br /&gt;Two tables is the better way to create this application. The second table would store all the category names seperately with a unique key. The unique key is just a number for each category, usually starting at 1 for the first category, 2 for the next, and so on. A record in the links table, which are the individual links, would also store this category number with the link. This number is then used to refer back to the category table to get the category name when needed. It is a little more complicated but it is a much better way to create the database.&lt;br /&gt;&lt;br /&gt;The benefits to using multiple tables is you get faster queries, and it is easier to manage the data. Some examples of the benefits of multiple tables:&lt;br /&gt;Faster query when selecting the list of all categories because you are querying a smaller set of data.&lt;br /&gt;Faster queries when selecting links by category, because the it is faster to select, group and sort numbers much faster then strings.&lt;br /&gt;Easier to manage because you can change the category names seperately from the links, since they only store the numbers as reference to the category name.&lt;br /&gt;Easier to enter data by category because you can pull the category name from the table and display it in a select form element instead of requiring the use to type it in.&lt;br /&gt;&lt;br /&gt;Using multiple tables (or databases) and relating their data to each other using keys is referred to as relational databases. Read more about relational database design from the related links below.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-3434918805652892536?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.blazonry.com/scripting/linksdb/start.php' title='MySql : Getting Started'/><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/3434918805652892536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=3434918805652892536&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3434918805652892536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3434918805652892536'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/mysql-getting-started.html' title='MySql : Getting Started'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-5507233668329853252</id><published>2008-07-02T00:29:00.005+07:00</published><updated>2008-07-02T00:34:59.410+07:00</updated><title type='text'>RDBMS : Architecture of a Database Management System</title><content type='html'>The architecture of a database management system can be broadly divided into three levels :&lt;br /&gt;&lt;br /&gt;a. External level&lt;br /&gt;b. Conceptual level&lt;br /&gt;c. Internal level&lt;br /&gt;&lt;br /&gt;&lt;img src="http://bp0.blogger.com/_MHwlIcvvQgk/SGpqIf0juVI/AAAAAAAAAAs/SdyVcCHmfDI/s320/untitled.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5218099812475582802" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The External Level&lt;/strong&gt;&lt;br /&gt;This is the highest level, one that is closest to the user. It is also called the user view. The user view is different from the way data is stored in the database. This view describes only a part of the actual database. Because each user is not concerned with the entire database, only the part that is relevant to the user is visible. For example, end users and application programmers get different external views.&lt;br /&gt;&lt;br /&gt;For example, an instructor will view the database as a collection of students and courses offered by the university. An administrator will view the database as a collection of records on the stock of course material provided by the university. The instructor is concerned with only a portion of database that is relevant to the instructor and the administrator is concerned with only the portion of database that is relevant to the administrator. These portions of database, which are viewed, by the instructor and administrator are reffered as their user’s view or external view.&lt;br /&gt;&lt;br /&gt;Each user uses a language to carry out database operations. The application programmer uses either a conventional third-generation language, such as COBOL or C, or a fourth-generation language specific to the DBMS, such as visual FoxPro or MS Access.&lt;br /&gt;&lt;br /&gt;The end user uses a query language to access data from the database. A query language is a combination of three subordinate language :&lt;br /&gt; Data Definition Language (DDL)&lt;br /&gt; Data Manipulation Language (DML)&lt;br /&gt; Data Control Language (DCL)&lt;br /&gt;&lt;br /&gt;The data definition language defines and declares the database object, while the data manipulation language performs operations on these objects. The data control language is used to control the user’s access to database objects.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Conceptual Level&lt;/strong&gt;&lt;br /&gt;This level comes between the external and the internal levels. The conceptual level represents the entire database as a whole, and is used by the DBA. This level is the view of the data “as it really is”. The user’s view of the data is constrained by the language that they are using. At the conceptual level, the data is viewed without any of these constraints.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;The Internal Level&lt;/strong&gt;&lt;br /&gt;This level deals with the physical storage of data, and is the lowest level of the architecture. The internal level describes the physical sequence of the stored records.&lt;br /&gt;Following is an example of the three levels :&lt;br /&gt;&lt;br /&gt;External&lt;br /&gt;Cout &lt;&lt; “Emp#” &lt;&lt; Employee_Code;&lt;br /&gt;Cout &lt;&lt; “Dept#” &lt;&lt; DepartmentEmployee_Code;&lt;br /&gt;Cout &lt;&lt; “Salary#” &lt;&lt; Salary;&lt;br /&gt;&lt;br /&gt;Conceptual&lt;br /&gt;Employee&lt;br /&gt;Employee_Code Character 6&lt;br /&gt;Department_Code Character 4&lt;br /&gt;Salary Numeric 5&lt;br /&gt;&lt;br /&gt;Internal&lt;br /&gt;Stored Employee Length=18&lt;br /&gt;Prefix Type=Byte(6), offset=0&lt;br /&gt;Emp# type=byte(6), offset=6, index empx&lt;br /&gt;Dept# type=byte(6), offset=12,&lt;br /&gt;Salary type=byte(6), offset=6&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Mappings&lt;/strong&gt;&lt;br /&gt;Mapping determines the correspondence between one level an another. There are two levels of mapping involved in this architecture. One is between the external and the conceptual levels, while the other is between the conceptual and the internal levels. The external-conceptual mapping determines the correspondence between the conceptual anad the user views. This specifies how a user views the conceptual data. The conceptual-internal mapping determines the correspondence between the conceptual and internal views. It specifies how the conceptual data is stored.&lt;br /&gt;&lt;br /&gt;The first step in designing a databse is to define the conceptual level. The conceptual level is then mapped to the external level. Each user view and the requirement is taken into consideration. Next, the conceptual-internal mapping is done. The way data is stored is derived from the conceptual level. Ths three-level architecture of a DBMS helps achieve data independence.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-5507233668329853252?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/5507233668329853252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=5507233668329853252&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/5507233668329853252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/5507233668329853252'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/07/rdbms-architecture-of-database.html' title='RDBMS : Architecture of a Database Management System'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp0.blogger.com/_MHwlIcvvQgk/SGpqIf0juVI/AAAAAAAAAAs/SdyVcCHmfDI/s72-c/untitled.JPG' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-7613852279673122568</id><published>2008-06-29T01:59:00.003+07:00</published><updated>2008-07-02T00:35:39.572+07:00</updated><title type='text'>RDBMS : Functional Components of a Database Management System</title><content type='html'>A database management system comparises many modules each dealing with a specific responsibility of the overall system. The functional components of a database management system are :&lt;br /&gt;&lt;br /&gt;a. Database Manager&lt;br /&gt;The database manager is the central software component of a DBMS. It is responsible for converting users queries to appropriate system calls. It maintains the consistency and integrity of the database and enforces data security. It also synchronizes the simultaneous operations performed by concurrent users. Apart from these, it also handles backup and recovery operations.&lt;br /&gt;&lt;br /&gt;b. File Manager&lt;br /&gt;The file manager services all requests for data. It identifies the block containing the requested record. The block is then requested from the disk manager. The file manager selects the requested record from the block and transmits it to the database manager. The file manager is also responsible for managing storage space and structures.&lt;br /&gt;&lt;br /&gt;c. Disk Manager&lt;br /&gt;The disk manager performs all the physical input and output. It interacts with the file manager and does read or write on the storage device as requested by the file manager. It views all data as row data. The operations performed by the disk manager are :&lt;br /&gt; Retrieves blocks of data&lt;br /&gt; Replaces blocks of data&lt;br /&gt; Removes blocks of data&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-7613852279673122568?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/7613852279673122568/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=7613852279673122568&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/7613852279673122568'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/7613852279673122568'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/06/functional-components-of-database.html' title='RDBMS : Functional Components of a Database Management System'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-8592138629849939980</id><published>2008-06-29T01:51:00.003+07:00</published><updated>2008-07-02T00:36:04.131+07:00</updated><title type='text'>RDBMS : Recovery From Deadlock</title><content type='html'>Once it is determined that a deadlock exitx, the system needs to recover from the deadlock. For this, one or more transactions are rolled back to break the deadlock. While performing the roll back operation, the following issues need to be addressed :&lt;br /&gt;&lt;br /&gt;a. Selection of a victim : in the situation of a deadlock, you first need to determine the transaction (or transaction) that should be rolled back to break the deadlock. Such a transaction is called the victim transaction. The transaction that will lead to minimum loss, in terms of cost, should be chosen for rollback. The following factors determine the cost of a rollback :&lt;br /&gt; How much execution has the transaction completed and for how much more time the transaction will execute to complete its task?&lt;br /&gt; How many data items were used by the transaction?&lt;br /&gt; How many more data items does the transaction need to complete?&lt;br /&gt; How many transaction will be included in the rollback?&lt;br /&gt;&lt;br /&gt;b. Rollback : after determining the transaction to be rolled back, you need to determine how far the transaction is to be rolled back. The easlest answer to this problem is to do a total rollback, which means that the transaction will be aborted and restarted. However, it is better to roll back the transaction only till the point where the deadlock can be broken. This method requires the DBMS to maintain information about all current transaction.&lt;br /&gt;&lt;br /&gt;c. Starvation : when the selection of a victim is based on cost factors, it might happen ihat the same transaction is selected as a victim every time a deadlock occurs. Due to this, the transaction might not be able to complete its task. Such a situation is called starvation. To avoid starvation, you need to ensure that a transaction is picked as a victim for only a fixed number of times. To ensure this, you can select a victim based on the number of rollbacks along with the cost factor.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-8592138629849939980?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/8592138629849939980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=8592138629849939980&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8592138629849939980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/8592138629849939980'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/06/recovery-from-deadlock.html' title='RDBMS : Recovery From Deadlock'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-3043749808488704827</id><published>2008-06-27T01:53:00.006+07:00</published><updated>2008-07-02T00:36:27.425+07:00</updated><title type='text'>RDBMS : Benefit of Database Management System</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_MHwlIcvvQgk/SGPmNp0HbRI/AAAAAAAAAAM/NuKwvRg6kHQ/s1600-h/Drawing3.jpg"&gt;&lt;img src="http://bp2.blogger.com/_MHwlIcvvQgk/SGPmNp0HbRI/AAAAAAAAAAM/NuKwvRg6kHQ/s320/Drawing3.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5216265915662298386" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/a&gt;A major advantage that the database approach has over the conventional approach is that a database management system provides centralized of data.&lt;br /&gt;&lt;br /&gt;Following are some of the benefits of the database approach :&lt;br /&gt;&lt;br /&gt;a. Redudancy is reduced : in the database approach, applications do not have to maintain their own data file. The same course data file is used by the course scheduling application, the instructor scheduling application, and the semester planning application.&lt;br /&gt;&lt;br /&gt;b. Inconsistency is avoided : because redundancy is reduced, inconsistency is also avoided. Consider a situation where ten students have enrolled for a course. This information is stored in the student data file. The other applications will use the same student file and therefore, no inconsistency can occur. If this information is recorded in more than one place, inconsistency can occur, as changes made in one data file may not get reflected in another data file.&lt;br /&gt;&lt;br /&gt;c. Data is shared : while the existing applications can share data in the database, new applications can also be developed that will use the same database.&lt;br /&gt;&lt;br /&gt;d. Standards are enforced : with centralized control of data, the DBA can ensure that standards are maintained in stored data formats. This is particularly useful for data interchange, or migration of data between two systems.&lt;br /&gt;&lt;br /&gt;e. Security restrictions are applied : the DBA eensures that only authorized persons have access to the database. The DBA defines the security checks to be carried out. Differenet checks can be applied to different operations on the same data. For instance, a person may have access to query a file, but may not have the right to delete or update that file.&lt;br /&gt;&lt;br /&gt;f. Integrity is maintained : inconsistency between two entries can lead to integrity problems. Even without redundancy, the database can still be inconsistent. For example, a student enrolls in 10 courses when the maximum number of courses a student can enroll is seven. Or, a student enrolls in a course that is not being offered in that semester. Such problems can be avoided in a DBMS by establishing certain integrity checks that are performed with any update operation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-3043749808488704827?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/3043749808488704827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=3043749808488704827&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3043749808488704827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/3043749808488704827'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/06/benefit-of-database-management-system.html' title='RDBMS : Benefit of Database Management System'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp2.blogger.com/_MHwlIcvvQgk/SGPmNp0HbRI/AAAAAAAAAAM/NuKwvRg6kHQ/s72-c/Drawing3.jpg' height='72' width='72'/><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-13407829.post-7321556886049816133</id><published>2008-06-27T01:44:00.004+07:00</published><updated>2008-07-02T00:36:55.722+07:00</updated><title type='text'>RDBMS : Introduction of DBMS</title><content type='html'>A database is a collection of records. One of the major tasks in a computer system is to store and manage data. To handle this task, you need a specialized computer software known as a database management system (DBMS). Database management systems are design to maintain large volumes of data. Management of data involves :&lt;br /&gt;&lt;br /&gt;a. Defining structures for data storage&lt;br /&gt;b. Providing mechanism for data manipulation&lt;br /&gt;c. Providing data security against unauthorized access&lt;br /&gt;&lt;br /&gt;Database management system are now available on a wide range of computer, from desktops to mainframes. The size and power of the computer determine the system facilities, such as security and storage.&lt;br /&gt;&lt;br /&gt;A single-user system allows only one person to access a database at any given time. In a multi-user system, several users can access a database simultaneously.&lt;br /&gt;&lt;br /&gt;With the increasing power of desktop computer, multi-user database systems are now available that support a small group of users to connect these desktop computers and access data concurrently. These database systems can be scaled up to support hundreds or thousands of users, depending on the configuration of the hardware on which the database system is running.&lt;br /&gt;&lt;br /&gt;The main objectives of any DBMS are to :&lt;br /&gt;&lt;br /&gt;a. Provide an efficient and convenient environment that is used to store data in, and retrieve data from a database.&lt;br /&gt;b. Manage information about users who interact with the DBMS and the activities that these users can perform on the data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/13407829-7321556886049816133?l=yaddarabullah.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://yaddarabullah.blogspot.com/feeds/7321556886049816133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=13407829&amp;postID=7321556886049816133&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/7321556886049816133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/13407829/posts/default/7321556886049816133'/><link rel='alternate' type='text/html' href='http://yaddarabullah.blogspot.com/2008/06/introduction-of-dbms.html' title='RDBMS : Introduction of DBMS'/><author><name>yaddarabullah</name><uri>http://www.blogger.com/profile/01647171231402532684</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='11811731609352552687'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry></feed>