name insertion into mysql database

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
djtrotman
User
Posts: 19

name insertion into mysql database

Post by djtrotman »

My hosting platform blocks input of names like O'BRIEN so in
Row inserting I have entered.
$rsnew['lastname']= mysql_real_escape_string($rsnew['lastname']);
And row rendered
$this->lastname->ViewValue = StripSlashes($this->lastname->ViewValue);
And row selected
$rs['lastname']= stripslashes($rs['lastname']);
Data goes into database ok and displays as O'Brien , the problem have on a search if I enter O'Brien nothing is displayed BRIEN display name ok O'BRIEN

Where do I have to change the input to get the search to work.


danielc
User
Posts: 1601

Post by danielc »

To change your searching criteria, use Recordset_Searching server event to change.


Webmaster
User
Posts: 9430

Post by Webmaster »

To change search values, you can also use the Recordset_SearchValidated server event.


djtrotman
User
Posts: 19

Post by djtrotman »

existing filter displays as lastname LIKE '%o\'mac% - database value is stored as = "o\'mac"
I thought this would have found the entry but comes back no records.


Webmaster
User
Posts: 9430

Post by Webmaster »

If the value is stored as "o\'mac", you should escape the "\" character too in the SQL, i.e.:

lastname LIKE '%o\\\'mac%'


Post Reply