Tuesday, July 16, 2019

How to use mysqli_connect() function in PHP?

How to use mysqli_connect() function in PHP?
The mysqli_connect() function in php is used to open a new connection to the MySQL server.
The syntax for the mysqli() function in php is written below: 
mysqli_connect(host, username, password, dbname, port, socket);
host server name or an IP address 
username Optional. For the MySQL username 
password Optional. For the MySQL password 
dbname Optional. For the default database to be used 
port Optional. For the port number to attempt to connect to the MySQL server 
socket Optional. Specifies the socket or named pipe to be used
This function return value is an object representing the connection to the MySQL server
<?php
   $con = mysqli_connect("localhost" ,"root" ,"" ,"demo");
   // check connection
   if(mysqli_connect_errno())
   {
       echo "connection failed".mysqli_connect_errno();
   }
   else
   {
      echo "database connection successfully";
   }
?>

Our Full PHP Tutorial Series


What is difference between Microcontroller and Microprocessor

Sunday, July 7, 2019

Introduction to PHP Programming Language

Introduction to PHP Programming Language

PHP is an abbreviation for Hypertext Preprocessor. Many of us know it as a scripting language. It is widely used for website development or web application development. And, PHP is also an open source programming language. What does this mean? So, the simple answer is that you can see the internal code of PHP and contribute to it.
Also, scripting language meaning is here - a program that is script-based (lines of code) written for the automation of tasks.
The core of a web application is web pages. Web pages can be created using HTML (Hypertext Markup Language). You HTML code execution is done on the client’s browser (client-side). On the other hand, the code written in PHP is executed on the server before it gets to the web browser of the user. Sounds interesting. Come, let's see with an example:

Example: An introductory example for PHP
<!DOCTYPE html>
<html>
    <head>
        <title>Example</title>
    </head>
    <body>
        <?php                                                                                                   
            echo "Hi Learners, Welcome to Engineering Capsule !";
        ?>
    </body>
</html>
The above code is simple. All the tags are from HTML like, <html>, <head>, <body>, <title>. In the middle of the code you can see something different that is PHP. After you run this on your browser as a simple HTML file, you’ll see PHP as it is. For compiling PHP, you have to run it on your server machine. 
Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, welcome to engineering capsule!"). The PHP code is enclosed in special start and end processing instructions <?php ?> that allow you to jump into and out of "PHP mode."

Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does "something" (in this case, output "Hi, welcome to engineering capsule!"). The PHP code is enclosed in special start and end processing instructions <?php ?> that allow you to jump into and out of "PHP mode."

Why PHP USED?

PHP can be inserted inside HTML, and it's well suited for web development and the creation of dynamic web pages for web applications, e-commerce applications, and database applications. It's considered a friendly language with abilities to easily connect with MySQL (mostly used database with PHP), Oracle, and other databases.
It also supports most web servers including Apache and IIS. Using PHP affords web developers the freedom to choose their operating system and web server.
In PHP, server-side scripting is the main area of operation. Server-side scripting with PHP involves:
  • PHP Parser: a program that converts source or human readable code into a format easier for the computer to understand
  • Web server: a program that process files that form web pages from user requests
  • Web browser: an application used to display content from the World Wide Web
In this instance, with the use of just a PHP parser, the PHP script can be executed without a server program or browser. This use of the PHP script is normally employed for simple text processing tasks, like task schedulers.
PHP can also be used for creating client-side applications, like desktop applications. Desktop applications are usually characterized by a graphic user interface. With knowledge in using the advanced features of PHP, such as PHP-GTK, these client-side applications can be developed.
Why use a PHP framework?
A PHP framework provides a basic predefined structure (or framework) for streamlining the development of websites or web applications. Web Developers use them because they speed up the whole development process.
Above all, the responsiveness of websites and applications built using PHP frameworks helps businesses fulfill their performance needs. 

Famous PHP Framework

1. Laravel

Laravel is among the top PHP frameworks. The year was 2011 when Laravel was came into existence. After its arrival its popularity made Laravel the cool frameworks among the PHP web developers. It has become the most popular free, open-source PHP framework in the world. Why? 
Because of the capacity to handle complex web apps securely, at a considerably faster speed than other frameworks used now-a-days. It simplifies the development process by easing common tasks such as routing, sessions, caching, and authentication.
2. CodeIgniter 
It is a tiny framework (it’s only about 2-3 MB in size, including its documentation). It is suitable for developing dynamic web pages. Different prebuilt modules help a developer to construct robust and reusable components.

3. Symfony

The first thing first. The Symfony Framework is a reliable and mature platform. Because it’s been in existence for much longer than other frameworks on this list. It was launched back in 2005. 
Symfony is an extensive PHP MVC (Model-View-Controller) framework and the only framework known to follow PHP and web standards to the tee.
4. CakePHP
Developer who are looking for an amazing toolkit that is simple and elegant, look no further. CakePHP will help you to develop visually impressive, feature-loaded web applications or websites. In addition, it is one of the easiest frameworks to learn for beginners, especially because of its CRUD (create, read, update, and delete) framework. CakePHP came to market in the early 2000s, and since then it’s gained better performance and many new components

5. Zend Framework

The Zend Framework is a complete object-oriented framework, and the fact that it uses features such as interfaces and inheritance makes it extendable. It was built on top of the agile methodology. And this helps you to deliver high-quality applications to enterprise clients. Zend is highly customizable and abides by PHP best practices—an important point for developers who want to add project-specific functionality.

Wednesday, January 31, 2018

Electric Bike – A new EV is coming to market in 2018

Electric Bike – A new EV is coming to market in 2018

Electric Bike Introduction
Electric bike and electric cars are cool and moreover, they are not polluting the environment. As Tesla’s CEO said that, they have a mission to provide the power from sustainable resources. This is the change, which will protect the mother Earth from global warming.
You have seen electric cars enter the market. In addition, this time a new electric model set to enter the market. Developed by Sweden-based Cake, the new electric model will begin delivering in summer 2018, according to their website.

Monday, January 22, 2018

Digital Marketing Future

Digital Marketing or Online Marketing Future?

Digital Marketing Future
See the change in digital marketing. 

What is Digital Marketing?

Introduction

Digital Marketing – So, you are here because you have heard the word Digital marketing or online marketing from many people around you. But not sure about what they are saying. This is not your fault at all. You are curious about this term that’s why you’re here, right! Now this article will tell you what the hell digital marketing is and how you can use it for your business.  For your business! Yes for your business. And also explain the scope of this beautiful trend. Also, what will be the future of digital marketing?

Why Digital Marketing or benefits of this?

Before the actual run, let’s see how much this latest trend will affect your business. Maybe your business is small, medium or big. You can make a big benefit from this. Why you use digital marketing in your business? Let’s answer this question first.
In simple terms Digital marketing/online marketing benefits businesses of all types or sizes by giving access to the giant market at an affordable price. Unlike TV or print ads, it allows truly personalized marketing.
If you ask what is the main advantage of marketing your business online. Then the answer is quite simple. It focuses a targeted audience in a cost-effective and measurable way.

Read More: Future of Digital marketing