This is the power of free and open-source software contribution. share...share...share...
Tuesday, September 20, 2011
Software Freedom Day
Monday, August 15, 2011
PHP
Adding Records to a MySQL Database with PHP
The only thing that needs to change is your SQL statement. The steps we're going to be taking are these:
- Open a connection to MySQL
- Specify the database we want to open
- Set up a SQL Statement that can be used to add records to the database table
- Use mysql_query( ) again, but this time to add records to the table
- Close the connection
We've already done steps 1 and 2 on the list. So we can move straight to Steps 3 to 5
In our previous script, we used some SQL to grab records from our Address Book database table. We then used a While loop to print all the records out. Because we're now going to be adding records to the Address Book table, we need some different SQL. Here's the script. The new line is in blue (The double and single quotes need to be entered exactly, otherwise you'll get errors when you run the code):
Set up a SQL Statement to add records to the database
In our previous script, we used some SQL to grab records from our Address Book database table. We then used a While loop to print all the records out. Because we're now going to be adding records to the Address Book table, we need some different SQL. Here's the script. The new line is in blue (The double and single quotes need to be entered exactly, otherwise you'll get errors when you run the code):
$user_name = "root";
$password = "";
$database = "addressbook";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
$SQL = "INSERT INTO tb_address_book (First_Name, Surname, Address) VALUES ('bill', 'gates', 'Microsoft')";
$result = mysql_query($SQL);
mysql_close($db_handle);
print "Records added to the database";}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}
?>
You met all of this code from the previous section. The only difference is the new SQL statement! What the code does is to set up some variables, open a connection to the database, and then execute the SQL query. Let's have a look at the new, and rather long, statement.
INSERT INTO … VALUES
To add records to your database, you can use the INSERT statement. There are plenty of ways to use this statement, but we'll stick with something simple: adding new values to all of our table columns.
You start by typing the words "INSERT INTO". This can be in any case you like: upper, lower or a mix. It's easier for you to read if it's in uppercase letters.
The next thing you need is the name of a table to insert your new values into. For us, this is the table that we've called tb_address_book.
Following the name of your table, type a pair of round brackets. Inside the round brackets, you can type the names of the columns in your table:
INSERT INTO tb_address_book (First_Name, Surname, Address)
Notice how we haven't included the ID column from our table. That's because the ID column was the one we set up to be an auto-incrementing number. We don't need to worry about this column because MySQL will take care of adding 1 to this field for us.Now that you've specified which table you want to insert values into, and specified your column names, you can add the values you want to insert.
To add values, you type the word "VALUES" after the round brackets of your column names:
INSERT INTO tb_address_book (First_Name, Surname, Address) VALUES
After the word "VALUES", you type another pair of round brackets. Inside of these brackets, you can type your values. Each value should be separated by a comma. You can use either direct text, like we've done, or variables. You can even get these values straight from your HTML form, which we'll see how to do later.So our whole line reads:
Notice how we've surrounded all of our text with double quotes. But inside of the values round brackets, we've used single quotes.
$SQL = "INSERT INTO tb_address_book (First_Name, Surname, Address) VALUES ('bill', 'gates', 'Microsoft')";
The syntax is really this (The SQL keywords are in blue):
INSERT INTO table_name ( Columns ) VALUES ( values for columns)
But try your code out now, and see if it's all working properly. You should find that you now have two records in your database table.Exercise
Replace the values 'bill', 'gates', and 'Microsoft' with values of your own. Run your script again to add your new record to the database. Now run your other script to read the values back out.
thanks to: http://www.homeandlearn.co.uk/php/php13p3.html
Monday, August 1, 2011
Wednesday, July 13, 2011
List of Projects
List of Projects Titles
# Development of a feature-rich, practical online leave management system (LMS)
# Development of a practical Online Help Desk (OHD) for the facilities in the campus
# Development of an auto-summarization tool
# Development of an agent-based information push mechanism
# Development of a feature-rich, practical online on-request courses coordination system (ORS)
# Development of an online Library Management System (LiMS)
# Development of an online Sales and Inventory Management System (SIMS)
# Development of a feature-rich, Employee Transfer Application
# Development of a feature-rich, Resume Builder Application
# Development of a safe and secure Internet banking system( Java based) OR Banking System in Visual Basic( Stand Alone)
# Development of a feature-rich, practical online intranet knowledge mgmt system for the college (KMS).
# Development of a feature-rich, practical online application for the Training and Placement Dept. of the college
# Development of a Repository and Search Engine for Alumni of College (RASE)
# Development of a split screen application for the data entry of the shipments.
# Development of a Campaign Information System
# Development of an e-Post Office System
# Development of a Lost Articles and Letters Reconciliation System
# Development of a feature-rich, practical online intranet knowledge mgmt system for the college (KMS).
# Development of a feature-rich, practical online application for the Training and Placement Dept. of the college
# Development of a Repository and Search Engine for Alumni of College (RASE)
# Development of a split screen application for the data entry of the shipments.
# Development of a Campaign Information System
# Development of an e-Post Office System
# Development of a Lost Articles and Letters Reconciliation System
# Student Project Allocation and Management with Online Testing System (SPM)
# Development of a user friendly ,feature-rich, practical Online Testing System (OTS).
# Development of a feature-rich, practical Resource Management System (RMS)
# Development of a feature rich, practical online Tickets reservation system for Cinema halls.
# Development of a feature rich, practical Time table generation system for a college.
# Development of a user friendly ,feature-rich, practical Appraisal Tracker
# Development of Effort Tracker System
# Development of a user friendly ,feature-rich, practical Online Testing System (OTS).
# Development of a feature-rich, practical Resource Management System (RMS)
# Development of a feature rich, practical online Tickets reservation system for Cinema halls.
# Development of a feature rich, practical Time table generation system for a college.
# Development of a user friendly ,feature-rich, practical Appraisal Tracker
# Development of Effort Tracker System
Wednesday, May 25, 2011
Want To Learn Web Programming? Write A Blog Engine
Want To Learn Web Programming? Write A Blog Engine
What is the best way learning any kind of programming? Write programs! I sincerely believe that a blog engine is one of the rare pieces which employs all the basics of Web programming but can be simple enough to understand. More importantly you can even choose to learn more than programming – about the concepts, modern technologies and architecture of the Web.
One of the problems that a novice faces is where to start from. All the aspects are so interleaved that it might be difficult to start from just one end. It can get quite frustrating to write a sample application as most of the times you lose the motivation for it down the line. Here are some reasons why even a minimal blog engine for yourself is a better candidate.
- There is no strict definition for a blog engine, rather it is flexible enough for you use your set of requirements. At the minimum, it is an application which takes input from you and publishes it.
- It involves one of the simplest interactions with the database. Note that the database does not imply a RDBMS, you are free to implement a file based storage for your blog engine. However it will make you think about CRUD and exceptions.
- Web interaction involved is minimal and lets you focus and learn the markup basics and specifications.
- A blog engine, by default, has at least two contexts – the homepage and a single blog entry. Understanding this is extremely crucial, as you can build your display based on this. Inherently this also means that a navigation system is required to read various blog entries. This can help you understand how contexts map to the navigation systems.
- Thinking about the user adding blog entries or managing them makes you design your management space.
- You can make various aspects configurable, so that the user can customize.
- Other users might want to classify their blog entries, and this will introduce you to categories for blog entries. Interestingly, allowing multiple categories is also a good lesson for basic RDBMS design, if you end up using it.
- You can then build a way of accessing these categories in your display system. This introduces you to more contexts. Technically this also makes you think about reusing your code for building archives.
- Creating valid markup.
- Using CSS for layout and styles. Though you might not be interested in visual design, this gives you enough exposure to how CSS works with markup.
- Ensuring all the readers can access the blog entries. This can be your introduction you to the concept of accessibility.
- One of the most critical aspects of the current trends in Web 2.0 is interaction with the readers. Introducing a comment system so that they can comment on the blog entries and start a discussion is a milestone in Web development. This makes your application a two-way communication system.
A blog engine is a basic publishing system and most of the Web activity hovers around publishing content. Not only does this let you try out various concepts, but it also lets you expand this into a full-fledged CMS.
Of course, you can also learn a lot by reading code of existing blog engines, there already some very good ones out there. However, as I always say, code represents only the solution, not the problem. Writing an application essentially involves the problem statement and requires its understanding. It involves taking decisions and your design is nothing but a combination of these decisions.
I see a blog engine at core of our Web interactions today, at least technically if not in usage. Its tolerance with its definition, freedom of design choices, programming paradigms and interaction with various users makes it the ideal learning tool. Needless to say that this will also let you build your expertise in the programming language you are using. If you find the choices too overwhelming, start by cloning an existing blog engine, I am sure you will add your originality to it.
Oh, this gives one more advantage. You can always find some good blog engines that come with their source, that is, they are open source. Is there any better way of stepping into the open source world?
Whether your blog engine gets used or not, is liked or not, is evolved or not, it will be the best learning tool you can ever build for yourself.
Thanks to http://ifacethoughts.net
Subscribe to:
Posts (Atom)

