This is a discussion on "PHP-MySQL problem" within the PHP Forum section. This forum, and the thread "PHP-MySQL problem are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
PHP-MySQL problem
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
PHP-MySQL problem
Hi,
I have the following code:
Thanks. Robert |
|
|
|
#2
|
|||
|
|||
|
Re: PHP-MySQL problem
$sec = htmlentities("Répertoires d'objets multimédias");
|
|
#3
|
|||
|
|||
|
Re: PHP-MySQL problem
The proper way to do this is to espace the '. To do so simply call addslashes.
|
|
#4
|
|||
|
|||
|
Re: PHP-MySQL problem
I think we're both wrong! A beter function would be mysql_real_escape_string(), anyone else with any better ideas?!?!
|
|
#5
|
|||
|
|||
|
Re: PHP-MySQL problem
mysql_real_escape_string is better as it uses the mysql connection but it is not necessary unless the input is from the user. However, when using mysql_real_escape_string you have to make sure the value is not numeric.
That is easily done but using the is_numeric function like so:
A. |
![]() |
| Tags |
| phpmysql, problem |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP problem in Apache/PHP/MySQL | JohnI | PHP Forum | 6 | Aug 7th, 2008 10:26 |
| Php/Mysql Image Problem | csun | PHP Forum | 11 | Oct 27th, 2007 20:12 |
| mySQL - PHP (problem) - XML - Flash | photofx | PHP Forum | 3 | Jul 27th, 2007 17:43 |
| Mysql syntax problem... | ktsirig | Databases | 1 | Jan 6th, 2006 15:51 |
| Mysql sorting problem.... | mills | Databases | 2 | Jul 26th, 2005 09:08 |