MySQL errors into PHP?

Here are some examples of how to utilize mysql_error ()

mysql_connect("your.hostaddress.com", 
"username", "password") or die(mysql_error()) 

This will return an error if there is a problem connecting to your MySQL database

 $value = mysql_query($your_query)
 or die("A MySQL error has occurred.<br />Your Query: " .
 $your_query . "<br /> Error: 
(" . mysql_errno() . ") " . mysql_error())

When you encounter an error, this will return your custom message (A MySQL error has occurred.<br />) followed by a line number, and the actual

thanks http://php.about.com/od/phpwithmysql/f/mysql_error.htm

How to redirect browser to https (ssl) in php

How to redirect the browser to https when site is using http protocal in PHP?

First of all, you should know that SSL must be installed in the server. To redirect the browser to “https” , we must know that the site is using SSL or not at the moment. And for this, there is a server variable in PHP called “HTTPS”. $_SERVER[‘HTTPS’] returns “on” values when the site is using SSL connection. Continue reading “How to redirect browser to https (ssl) in php”