mysql - query to get n characters of string from the database table field with php codeigniter -
//---query n characters of string database table field php codeigniter
//--view page
<?php foreach ($query $row) { $content = $row->blogger_content; ?> <p> <?php echo $content; ?> (here want list content needed first 25 character) </p> <?php } ?> // query want use here..?
try in model class.
$this->db->select(substring(columnname, 0, 25)) ->from(tablename) ->get();
Comments
Post a Comment