Skip to main content

Posts

PHP MySQL Connection management AND Database Operations

  PHP MySQL Connection management AND Database Operations The initial step involves establishing a connection to work with the database in PHP. PHP will therefore need to authenticate itself: we say that it establishes a connection with MySQL. To connect using PDO (PHP Data Objects), we need to instantiate the PDO class, passing the database source (server + database name) and a username and password as parameters to the constructor. Method 1: Using a Function <?php //PDO connexion function Connexion ( ) { $hostname = "localhost" ; $username = "The_name_of_your_user" ; $password = "your_password" ; $databasename = "The_name_of_your_DB" ; try { $conn = new PDO ( "mysql:host= $hostname ;dbname=The_name_of_your_DB" , $username , $password ); // set the PDO error mode to exception $conn -> setAttribute (PDO:: ATTR_ERRMODE , PDO:: ERRMODE_EXCEPTION ); echo "C...
  Application Programming Interface  RESTful APIs Mobile applications can retrieve data from the user’s device application, an online source, or the database. L et’s start with  API , which stands for  application programming interface : It is a set of rules and protocols that allows different software applications to communicate with each other. The number of APIs globally is growing rapidly, with  Postman reporting typical growth of 39 percent in the last year . More simply , In a restaurant, when you’re ready to order, you have a menu to make your food selection. You choose your desired dish. After finalizing your order, the waiter takes note of it and then takes it to the chef. The latter then prepares your meal accordingly, and the waiter serves it to your table. This process is straightforward for you as a diner since you don’t need to concern yourself with the steps of how the food is cooked. In this scenario, the waiter functions as an intermediary, simi...
  ScrollView Vs FlatList Vs SectionList C omponents in “ React Native” To display the menu items on the mobile screen and to offer a good UX, users should be able to scroll up and down the menu, you can use ScrollView which will load the items immediately after the component has been loaded so all data is stored in RAM. The ScrollView component has only one rule. It must be bounded by a height in order to work. This means we need to make sure that all the parent views have a bounded high. An app using this component would render all items in the list at once.  The output of the code snippet is : The FlatList component serves as an effective tool to render a large scrollable list of items. Employing a technique known as lazy rendering : items are rendered as the user encounters them in the app and are removed when the user scrolls away from them. So, the FlatList renders large lists without sacrificing app performance. This results in faster rendering and great perfor...
  CSS with superpowers T his blog aims to improve your CSS abilities, clean up your code, and save a lot of time by using Sass . Sass , which stands for S yntactically A wesome S tylesheet, is a Cascading Style Sheets (CSS) extension and has the “ .scss ” file extension. it is completely compatible with all versions of CSS. In addition, Sass has more features and capabilities than any other CSS extension language currently available and There are an endless number of frameworks built with it: Compass, and Bourbon, are just a few examples.           Check out for more :           https://sass-lang.com/ However, Sass includes extra features such as CSS variables and nested rules, which make CSS more efficient and easier to edit. Begin with the CSS variables . For instance, with CSS, if color is one that we commonly use, we must define it each time we want to utilize it. When using Sass , it is much simpler becau...
  Am I an entrepreneur? Are you an entrepreneur? You are an entrepreneur when you saw a need and assumes the risks of a business or enterprise. An   entrepreneur  is an individual who creates a new business, bearing most of the risks and enjoying most of the rewards. The process of setting up a business is known as entrepreneurship. The entrepreneur is commonly seen as an innovator, a source of new ideas, goods, services, and business/or procedures. According to SBA, Over 627,000 new businesses open each year, At the same time, about 595,000 businesses close each year (latest statistics as of 2008). 43% knew someone who had stopped a business in 2020 as a result of the pandemic, while 25% knew someone who had started a business amid the pandemic as stated in the   Global Entrepreneurship Monitor Research . let’s start with the profile of a good entrepreneur : Growth mindset : it’s a concept developed by Carol Dweck so he concluded that individuals who believe their t...