![]() |
warning in mysql_real_escape_string
Good day!
I am new in template in php like calling the .html webpage in php and I encountered warning in mysql_real_escape_string here is my code: PHP Code:
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /opt/zeva/releases/ZEVA.sandbox/machine_problem/rhoda/index.php on line 20 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /opt/zeva/releases/ZEVA.sandbox/machine_problem/rhoda/index.php on line 20 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /opt/zeva/releases/ZEVA.sandbox/machine_problem/rhoda/index.php on line 21 Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /opt/zeva/releases/ZEVA.sandbox/machine_problem/rhoda/index.php on line 21 |
Re: warning in mysql_real_escape_string
Your not opening a MySQL connection is why there is that error. MySQL's engine does the escaping not php which is why its mysql_real_escape_string(); also try error suppression so you can test it via if statement and display your desired error message. Make a new .php file and name it dbconfig.php set your database connection in it and include it in this file. You could also use a simple php CRUD implementation to since your queries are fairly simple it would save you in code time. try these orm to help speed your code up and simplify it to.
ORM http://www.propelorm.org/ Framework http://www.akelos.org/ or new file PHP Code:
|
Re: warning in mysql_real_escape_string
better to use trim(htmlspecialchars(value)) instead of mysql_real_escape_string function
|
Re: warning in mysql_real_escape_string
mysql server died
|
| All times are GMT +5.5. The time now is 20:50. |