Re: Problem of using ereg_replace before saving data to database

2006-09-19 Thread Andrew Assarattanakul
If you must use ereg_replace though I don't recommend for this situation you need to define that the variable is a string by using strval function. if (!empty($this-data)) { $this-ereg_replace( , _, strval($this-data['Category']['cat']))); $this-save($this-data)); }

Problem of using ereg_replace before saving data to database

2006-09-18 Thread andz.christian
Good day Guys n Gals. Lately I'm having a little bit problem of using ereg_replace before saving data to database. I have this category table and i want to replace white space with underscore. I have this fields on my database: Table_name: Category Fields: id, cat I've tried this code

Re: Problem of using ereg_replace before saving data to database

2006-09-18 Thread Larry E. Masters aka PhpNut
if (!empty($this-data)){ $this-data['Category']['cat'] = str_replace( , _, $this-data['Category']['cat']); $this-save($this-data);}ereg_replace is not a method of a class it is a php function and for what your doing it is not very good function to use anyway -- /*** @author Larry E. Masters* @var