I am using PHP and MySql. TeX is posted to server.php file through a form and exploded into an array:
foreach($_POST['ques'] as $i){
$arr = explode('~', $i);
}
$sql = "INSERT INTO `QUESTIONS`(`Text`) VALUES ('$arr[2]')";
$run = mysql_query( $sql, $conn ) or die(mysql_error());
Btw echo $arr[2]; shows correct Tex syntax : "[\Rightarrow{z=\frac{43}{-44}}]"
But on database it is stored without backslashes "[Rightarrow{z=frac{43}{-44}}]"