<?php $get_arr_of = new get_arr_of; $get_arr_of_cat = $get_arr_of->cat("SELECT * FROM download_cat WHERE id='".ID."' limit 0, ".$get_no_of_file.""); while ($row = $get_arr_of_cat) { $desc_before = $row['desc']; $desc = $desc_before.'...'; } else { $desc = $desc_before; } } ?>
<?php class get_arr_of { public function __construct($host = 'localhost', $user = 'root', $pass = '', $db = 'download') { $this->host = $host; $this->user = $user; $this->pass = $pass; $this->db = $db; } function cat($query) { } } ?>
Macie jakieś pomysły jak to rozwiązac?
Można puścic pętle for, ale to chyba zły i obciążający pomysł?