mysql - Preserving spaces in string when concatenating in php -
i having problem in saving spaces when concatenating string in php. meant used sql query spaces important.
$sql_query = 'select * from'; $sql_query .= 'table_id'; $sql_query .= 'where user_id = 5';
and end getting
select * fromtable_idwhere user_id = 5
please note giving illustration , not real query, trying find general way command spaces when concatenating. thanks
$sql_query = 'select * '; $sql_query .= 'table_id '; $sql_query .= 'where user_id = 5';
when concatenate string, interpreted exactly have written it. means, php not add together spaces - must yourself.
php mysql
No comments:
Post a Comment