Skip to main content

Posts

Showing posts with the label database

How to Connect Python with MySQL Database

  How to Connect Python with MySQL Database T oday, We will learn on how to connect Python with Mysql. This tutorial will let you know how python can be used with database applications. Before starting with our tutorial, we need to have MySQL installed in your System. You can download the MySQL database form   https://www.mysql.com/downloads/ In order to connect with MySQL, Python requires Mysql Driver. So, as the next step towards database connectivity we can now install MySQL Driver. Open Command Prompt or terminal and type the following commands. We will be using PIP for faster and safer installation of the packages.  Command to Install MySQL Connector python - m pip install mysql - connector Now, we have done installing Mysql Connector. Our next process is to test the installation. Let's do that by simply importing the mysql connector package. import mysql . connector If the above import statement did not produce any errors or warnings, then hurrah! we've successfull...

How to Connect PHP to MySQL Database?

  How to Connect PHP to MySQL Database? In this tutorial we will be learning about how to connect to MySQL Database Management System with PHP. Some Points on MySQL MySQL uses Standard SQL MySQL is free to download MySQL is best suitable for Small and Large Applications Some Points on PHP PHP is a server scripting language PHP scripts are executed in server and pure HTML is returned back to client. PHP files have extension  .php PHP is easy to Learn and implement PHP supports both Structural Programming Paradigm and Object Oriented Programming Paradigm. 1. First, Let's create a Database in MySQL CREATE DATABASE TestDB ; 2. Let's create a Table in TestDB CREATE TABLE testTABLE ( id INT , Fname VARCHAR ( 50 ) , Lname VARCHAR ( 50 ) , EmailID VARCHAR ( 120 ) ) ; 3. Let's Connect to TestDB $mysql_host = "localhost" ; //host address may vary. ex : localhost:3302 $mysql_user = "root" ; //Given by your hosting provider $mysql_pass = ...

C Program to show an example of Memory Management

  C Program to show an example of Memory Management # include <fcntl.h> # include <sys/types.h> # include <stdio.h> # include <unistd.h> # include <sys/resource.h> void main ( void ) { printf ( "\n The current location of the program break: %d\n" , ( int ) sbrk ( 0 ) ) ; int * t = sbrk ( 200 ) ; printf ( "\n After incrementing program's data space by 200 bytes using sbrk() system call" ) ; printf ( "\n The current location of program break: %d\n" , ( int ) sbrk ( 0 ) ) ; printf ( "\n Setting the end of data segment using brk() system call" ) ; brk ( t ) ; printf ( "\n The current location of the program break:%d\n" , ( int ) sbrk ( 0 ) ) ; }