Posts

How to Import CSV File Data Into Mysql Using PHP

Image
If you are a developer then definitely you might have faced this. Many times you  need to import data from a CSV (comma separated value) file and insert it into your MySQL database. Say for Example consider a case when you have many records in a CSV file and you need to import them into your MySQL database then you can’t  insert each n every single record manually as it will take too much time. This case arises mostly when you want to import existing data in your website. In this tutorial I am going to  explain you how easily you can do that. SQL query to create csvdata table: CREATE TABLE IF NOT EXISTS `csvtbl`(  `ID` int(10) NOT NULL AUTO_INCREMENT,  `name` varchar(50) NOT NULL,  `city` varchar(50) NOT NULL,  PRIMARY KEY (`ID`) ) csvimport.php File Download File <?php  //database connection details $connect = mysql_connect('localhost','root','123456'); if (!$connect) {  die('Could not connect to MySQL: ' . mysql_error());  } //your ...

Database Transaction basic

Database transaction: A transaction is a unit of program execution that accesses and possibly updates various data items.A transaction has many program segment such as read segment, write segment etc. We combine all segment as a unit and call it database transaction. A transaction require to maintain the following properties. These properties are often called the ACID properties. Given below the ACID properties of a transaction: Atomicity:   All operations of a transaction must be completed otherwise the program must aborted. Consistency: Database consistency stats that only valid data will be written to database. Database consistency says that total sum of enter program of a transaction must unchanged. If a transaction violets the database consistency rules, the entire database will be rolled back and the database restored. Isolation: Isolation means multiple transactions occurring at same time but not impact each other execution. A transaction X and another transaction Y occur at...

10+ database project ideas

To build any application you need to work with large data and you need to manage this data. To manage data we use database such as Oracle database, Microsoft database, MySQL database etc. We store our data in database. To retrieve or extract data we use SQL query. The SQL query are same for all database. In this discussion I will give you some database project idea . Before describing project idea I want to share with you some useful information. First of all you need to think. Think what problem you want to solve? In your area or in your country, there are many kinds of unsolved problem. Such that in my school life our school librarian maintain our school library using paper. This process is time consuming. To solve this problem I just think automated online library management system. When your thinking is completed, then you need to do some paper work. Try to sketch some diagram and think how to solve that problem using diagram. You need to draw E-R( Entity -R...

How to Disable Notification Sounds on Facebook?

Image
Facebook notifications.They  are the best way to alert you on the latest updating on your Facebook profile.It includes all the things means posts, status messages, comments, chat and all. But it would be annoying and sometime  distracting too if you are continuously receiving notification sounds on Facebook. But luckily there is a option in the ‘Account settings’ that will allow you to disable all the notification sounds on Facebook. STEPS TO FOLLOW :  1. Look at the top-right corner of the page, you will find the ‘wheel icon’ . Now click on it and then choose ‘Account Settings’ from the drop-down. 2. Now, on the left hand side, click on the ‘Notification’ option. 3. Next, in the sub-section, you will find ‘How you Get Notifications’ menu.Here you  will see different options like      • On Facebook: All notifications, sounds on     • Email: Only important notifications     • Push notifications: Some notifications ...

How to Compress PNG Images without Loss of Quality?

Image
PNG ( P ortable N etwork G raphics) files are famous for their lossless image format. But there is one disadvantage to having .png image files,say for example, the resulting file size of PNG files can sometimes be larger than the JPEG files.I was dealing with PNG images for reducing their size but I didn’t want to compromise with their quality.While searching for this,found one amazing tool named “ PNGGauntlet ” -  a free Windows utility that helps in reducing the size of PNG files without affecting its quality. How to use PNGGauntlet ? • You must have Microsoft .NET framework 4.0 or higher on your system in order to use PNGGauntlet. • Once both of them get installed, simply launch the tool and add the PNG files that you want to compress. Batch compressing is also supported. • Next, select the output directory (where the compressed PNG files should be saved) • Click ‘Optimize’ button. When I was searching for the solution to accomplish my requirement,I found one Online tool  t...

Characters Counter in Javascript

Image
You may have seen characters counter while sending messages from online free message services or in some cases while filling up online registration forms.In this article you will learn how to create character counter in javascript. Javascript <script type="text/javascript"> //You can change the counter/limiter value as your wish var count = "125";   function limiter(){ var textvalue = document.demoform.message.value; var len = textvalue.length; if(len > count){ tex = textvalue.substring(0,count); document.demoform.message.value =tex; return false; } document.demoform.limit.value = count-len; } </script>  HTML Code <html> <body> <form name="demoform" method=”post”> <table><tr><td><strong>Characters Counter Demo</strong></td></tr> <tr><td colspan="2"><textarea name=message rows=3 cols=40 onkeyup=limiter()></textarea></td></tr> <tr...

Drupal 8's Javascript: What is new?

The introduction of the famous Drupal CMS left the world amused with full of hopes and prospects. The current running Drupal7.x has proven a success to the larger market. However, there have been several worries raised as to the circumstantial hitches on the block menu in the Drupal CMS series. The development, theme team and the entire Drupal community have been able to overcome the issues successfully. This was handled in the release of Drupal 7.12 and Menu Block 2.3. This gives users a blank page in the site’s output. The process of updating the CMS has been tough but tremendous changes have been incremental to the good look of the CMS. The latest version of the Drupal CMS, Drupal 8, has been propelled by a couple of ideas ranging from innovativeness to the need for a more inclusive, comprehensive CMS. The updates were realized in the Drupal conference of the year 2012. Drupal 8’s Javascript (JS) is one of the breathtaking features of this CMS series. This change has brought about c...