Posts

PHP programming for DBMS

Open a Connection to MySQL <?php $servername =  "localhost" ; $username =  "username" ; $password =  "password" ; // Create connection $conn =  new  mysqli($servername, $username, $password); // Check connection if  ($conn->connect_error) {      die ( "Connection failed: "  . $conn->connect_error); }   echo   "Connected successfully" ; ?> Close the Connection $conn->close(); Create a MySQL Database // Create database $sql =  "CREATE DATABASE myDB" ; if  ($conn->query($sql) === TRUE) {      echo   "Database created successfully" ; }  else  {      echo   "Error creating database: "  . $conn->error; } $conn->close(); Create a MySQL Table // sql to create table $sql =  "CREATE TABLE MyGuests ( id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,  firstname VARCHAR(30) NOT NULL, lastname VARCHAR(3...

Raspberry Pi - pins

Image
First let's get familiar with the numbering/ labeling system of the pins on the board. There are two numbering conventions, one is as per the Broadcom SOC (called bcm here and everywhere else) and one as per the numbering printed on the board (simply called board). The numbers in big bold towards the extremes of the diagram refer to the bcm naming convention , which is usually preferred since it remains the same throughout the various models. The numbering next to the colorful circles(i.e. the pins) are the number printed on the board. You might argue why two different conventions, it is because the bcm refers to the internal(logical?) of the SoC while the board represents it's physical location . Let us first understand the various data/bit transferring protocol before we talk about the individual pins.  I2C This protocol was found by Philips electronics and is popular for the reason that only two pins are required to connect to a device. It is the cous...

Raspberry Pi - introduction

Image
Hi guys, it's my first blog. I'm still learning a lot of stuff and this blog is to keep track of what I'm learning and also to spread whatever I know to the community . Raspberry Pi is a SOC (System on Chip) with immense potential, although it serves as the base for commercial projects, it is discarded in production. System on chip means that the entire components like the processor,memory,GPU is combined on a single chip, unlike traditional desktops in which components are spread apart so as to provide flexibility and upgradability (I don't think it's a word). It includes a processor, a graphics chip, some RAM, a few USB ports, an HDMI output, an Ethernet port, and (in the latest version) integrated wifi and Bluetooth. It is more similar to mobile phones in terms of overall deign and architecture than traditional desktops, since it has an ARM based processor and VideoCore -IV graphics. So i.e. normal OSes meant for the x86 based machines wouldn't run o...