I'm just finishing the first release of automailer, a program that I've been working for a while. I just have to finish writing the installer. Its work is to rewrite the codeigner configs from templates that I have got to read / write stuff, but I want to be able to test the credentials given by the user, if they are wrong system error Without throwing it Is there any work other than mysql_connect that I can use to test a connection that is true or false and will not fit the codigator?
I have it
function_test_connection () {if (mysql_connect ($ _ POST ['host'], $ _POST ['username'], $ _POST [ 'Password'], TRUE) TRUE; And returned the wrong; }
The codigator does not like it and throws a system error.
& lt; Div style = "border: 1px solid # 990000; padding-left: 20px; margin: 0 10px 0;" & gt; & Lt; H4 & gt; Encountered a PHP error & lt; / H4 & gt; & Lt; P & gt; Seriousness: Warning & lt; / P & gt; & Lt; P & gt; Message: mysql_connect () [& lt; A href = 'function.mysql-connect' & gt; Function.mysql-connect & lt; / A & gt;]: Unknown MySQL server host 'x' (1) & lt; / P & gt; & Lt; P & gt; Filename: Controller / install.php & lt; / P & gt; & Lt; P & gt; Line number: 57 & lt; / P & gt; & Lt; / Div & gt;
I do not want to stop error reporting.
You can use to throw error by using PHP.
Note that it is not a good idea to use it most of the time because it will also hide any errors.
Find out more about the section on PHP manual to learn.
Comments
Post a Comment