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));
}
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
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