Php and MySQL Long Text Problem

Though mysql casting is one of the way to address special characters in the text,there is another simple function which lets  you to do this..
This http://php.net/manual/en/function.mysql-real-escape-string.php  lets you to do this very easily

require_once’config1.php’;
$sn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $sn);
$a=file_get_contents(”http://www.google.com”);
echo $a;
$a1=”";
//Making Mysql escape string
$query = sprintf(”INSERT INTO `testingtable` ( `no` , `a1` )VALUES (%d , ‘%s’)”,
mysql_real_escape_string($a1,$sn),
mysql_real_escape_string($a,$sn));
//Inserting the [...]



Changing Database in MySQL via command prompt

Usually in Xampp mysql would be in mysql/bin
you can access SQL database through PhpmyAdmin and also through Command Prompt
To access MySQL through Command Prompt
a)First access the mysql/bin folder  via command Prompt
b)Then at command Prompt type

mysql.exe -u ganesh -p
Enter password:
c)It would ask for password.When you type the password it would not be shown at the command [...]



Php code for connecting to a MySQL Database

Here is the Php code for connecting to MySQL Database
$mysql_hostname = “mysqlserver”;
$mysql_user = “mysqlusername”;
$mysql_password = “mysqlpassword”;
$mysql_database = “mysqldatabase”;
set_time_limit(6000);
$sn = mysql_connect($mysql_hostname, $mysql_user, $mysql_password);
mysql_select_db($mysql_database, $sn);

The last two lines are important as they connect to MySQL Database using Username,Password,hostname and Database
Here Mysqlserver,mysqlusername,mysqlpassword,mysqldatabase should be replaced by your own values



BETWEEN Command in SQL

BETWEEN command in SQL is used to select a values between ranges in the field itself .Suppose there is a list of students in the class. They are 60 in number and all their details are stored in the Database according to alphabetical order

Suppose if you want to see who have scored between 60 and [...]