Posts

Showing posts with the label php

QR Code

https://reeteshghimire.com.np/2020/03/10/generate-qr-code-using-php-library/ According to Wikipedia, QR code (Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed in 1994 for the automotive industry in Japan. A barcode is a machine-readable optical label that contains information about the item to which it is attached. In practice, QR codes often contain data for a locator, identifier, or tracker that points to a website or application. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to store data efficiently; extensions may also be used. Installation Install endroid/qr-code library using composer $ composer require endroid/qr-code GitHub Link Here :  QR Code Generator First Download the library and then create a index.php file with the following code in it: <?php include ( 'vendor/autoload.php' ) ; use Endroid\QrCode\QrCode; $qrCode = new Q...

PHP Source Code for backing up Database

http://reeteshghimire.com.np/2019/07/04/backup-restore-mysql-database-using-php/ https://stackoverflow.com/questions/22195493/export-mysql-database-using-php-only <?php $connection = mysqli_connect ( 'localhost' , 'root' , '' , 'quiz' ) ; $tables = array ( ) ; $result = mysqli_query ( $connection, "SHOW TABLES" ) ; while ( $row = mysqli_fetch_row ( $result ) ) { $tables [ ] = $row [ 0 ] ; } $return = '' ; foreach ( $tables as $table ) { $result = mysqli_query ( $connection, "SELECT * FROM " .$table ) ; $num_fields = mysqli_num_fields ( $result ) ; $return .= 'DROP TABLE ' .$table. ';' ; $row2 = mysqli_fetch_row ( mysqli_query ( $connection, "SHOW CREATE TABLE " .$table ) ) ; $return .= "\n\n" .$row2 [ 1 ] . ";\n\n" ; for ( $i= 0 ;$i<$num_fields;$i++ ) { while ( $row = mysqli_fetch_row ( $result ) ) { $return .= "I...