Tag Archives: mysql

Create a CSV file using PHP and MYSQL

As we know that CSV files are one of the most used way to back-up mysql database and tables. However it is very simple to export or backup your mysql database table as CSV file if you have PhpMyAdmin interface installed on your server. Actually problem arises when we have to deal with a shared…

Leave a comment

Filed under PHP

Php Interview Questions and Answers – Part 8

Php Interview Questions and Answers – Part 8
1- Give the syntax of REVOKE commands?
The generic syntax for revoke is as following
REVOKE [rights] on [database] FROM [username@hostname]
Now rights can be:
a) ALL privileges
b) Combination of CREATE, DROP, SELECT, INSERT, UPDATE and DELETE etc.
We c…

Leave a comment

Filed under PHP

Create Database and Tables in PHP MySQL

As We know database holds one or multiple tables. Here in this post you will learn how create database tables in Mysql
Create a Database
We use the CREATE DATABASE statement to create a database in MySQL.
Syntax
CREATE DATABASE database_name
To get PHP to execute the MYSQL statement we must use…

Leave a comment

Filed under PHP

Php Interview Questions and Answers – Part 3

1- What is the difference between CHAR and VARCHAR data types?
CHAR is a fixed length data type. CHAR(n) will take n characters of storage even if you enter less than n characters to that column. For example, “Hello!” will be stored as “Hello! ” in CHAR(10) column.
VARCHAR is a variable…

Leave a comment

Filed under PHP

Php Interview Questions and Answers – Part 2

1- Why doesn’t the following code print the newline properly? <?php $str = ‘Hello, there.nHow are you?nThanks for visiting techpreparation’; print $str; ?>
Because inside the single quotes the n character is not interpreted as newline, just as a sequence of two characters – and…

Leave a comment

Filed under PHP

Mysql Full Text Search – Mysql

In this post you’ll learn how to build a basic full-text search engine using PHP and MySQL.
What is full text search?
The full-text search in mysql allows you to quick and very accurate search for single or multiple keywords from multiple columns. It does this by using an index on the columns…

Leave a comment

Filed under Uncategorized