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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -