Skip to main content

Posts

Showing posts from December, 2020

PHP - AJAX

PHP - AJAX Introduction AJAX is about updating parts of a web page, without reloading the whole page. What is AJAX? AJAX = Asynchronous JavaScript and XML. AJAX is a technique for creating fast and dynamic web pages. AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page. Classic web pages, (which do not use AJAX) must reload the entire page if the content should change. Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs. How AJAX Works AJAX AJAX is Based on Internet Standards AJAX is based on internet standards, and uses a combination of: XMLHttpRequest object (to exchange data asynchronously with a server) JavaScript/DOM (to display/interact with the information) CSS (to style the data) XML (often used as the format for transferring data) AJAX applications are browse

PHP XML

PHP XML Parsers What is XML? The XML language is a way to structure data for sharing across websites. Several web technologies like RSS Feeds and Podcasts are written in XML. XML is easy to create. It looks a lot like HTML, except that you make up your own tags. If you want to learn more about XML, please visit our XML tutorial. What is an XML Parser? To read and update, create and manipulate an XML document, you will need an XML parser. In PHP there are two major types of XML parsers: Tree-Based Parsers Event-Based Parsers Tree-Based Parsers Tree-based parsers holds the entire document in Memory and transforms the XML document into a Tree structure. It analyzes the whole document, and provides access to the Tree elements (DOM). This type of parser is a better option for smaller XML documents, but not for large XML document as it causes major performance issues. Example of tree-based parsers: SimpleXML DOM Event-Based Parsers Event-based parsers do not hol

MySQL Databases PDO

PHP MySQL Use The ORDER BY Clause Select and Order Data From a MySQL Database The ORDER BY clause is used to sort the result-set in ascending or descending order. The ORDER BY clause sorts the records in ascending order by default. To sort the records in descending order, use the DESC keyword. SELECT column_name(s) FROM table_name ORDER BY column_name(s) ASC|DESC To learn more about SQL, please visit our SQL tutorial. Select and Order Data With MySQLi The following example selects the id, firstname and lastname columns from the MyGuests table. The records will be ordered by the lastname column: Example (MySQLi Object-oriented) connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT id, firstname, lastname FROM MyGuests ORDER BY lastname"; $result = $conn->query($sql); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) { echo "id: " . $row["id"].

MySQL Database

PHP MySQL Database With PHP, you can connect to and manipulate databases. MySQL is the most popular database system used with PHP. What is MySQL? MySQL is a database system used on the web MySQL is a database system that runs on a server MySQL is ideal for both small and large applications MySQL is very fast, reliable, and easy to use MySQL uses standard SQL MySQL compiles on a number of platforms MySQL is free to download and use MySQL is developed, distributed, and supported by Oracle Corporation MySQL is named after co-founder Monty Widenius's daughter: My The data in a MySQL database are stored in tables. A table is a collection of related data, and it consists of columns and rows. Databases are useful for storing information categorically. A company may have a database with the following tables: Employees Products Customers Orders PHP + MySQL Database System PHP combined with MySQL are cross-platform (you can deve

PHP OOP

PHP - What is OOP? From PHP5, you can also write PHP code in an object-oriented style. Object-Oriented programming is faster and easier to execute. PHP What is OOP? OOP stands for Object-Oriented Programming. Procedural programming is about writing procedures or functions that perform operations on the data, while object-oriented programming is about creating objects that contain both data and functions. Object-oriented programming has several advantages over procedural programming: OOP is faster and easier to execute OOP provides a clear structure for the programs OOP helps to keep the PHP code DRY "Don't Repeat Yourself", and makes the code easier to maintain, modify and debug OOP makes it possible to create full reusable applications with less code and shorter development time Tip: The "Don't Repeat Yourself" (DRY) principle is about reducing the repetition of code. You should extract out the codes that are common for the applicatio