Sep 10, 2013 13:14
soo, php :D
Sep 10, 2013 13:14
(i mostly do design, but sometimes people want web) and I hate wordpress and joomla etc
Sep 10, 2013 13:13
:)
Sep 10, 2013 13:13
so, any help is wellcomed
Sep 10, 2013 13:13
well, i'm semibeginner :D
Sep 10, 2013 13:11
for your time
Sep 10, 2013 13:11
thank you
Sep 10, 2013 13:11
will do
Sep 10, 2013 13:11
.
Sep 10, 2013 13:11
and it is easy for changes
Sep 10, 2013 13:10
in sepearate file
Sep 10, 2013 13:10
and i place it under httacces
Sep 10, 2013 13:10
i really don't know no more, i use it for more than year or so, found it the best way so far for interaction with db, didn't have any problems, it gives me the flexibility
Sep 10, 2013 13:09
you mean this core.php code?
Sep 10, 2013 13:07
will rearrange fetching
Sep 10, 2013 13:07
i'll manage under 10 instances
Sep 10, 2013 13:07
thank you for your help
Sep 10, 2013 13:07
internal error 500 again
Sep 10, 2013 13:02
@FDL where do i try it, insted of for loop?
Sep 10, 2013 12:59
Royal, nop, error 500 again
Sep 10, 2013 12:58
tried taking out the intire for loop, now no data gets returned
Sep 10, 2013 12:54
500
Sep 10, 2013 12:54
gives me interntal server error
Sep 10, 2013 12:54
$this->db->fetchAll()
Sep 10, 2013 12:52
will try now, pls wait sec
Sep 10, 2013 12:51
the last one, allways
Sep 10, 2013 12:51
I tested it by rearranging the order
Sep 10, 2013 12:50
only first 9 works
Sep 10, 2013 12:50
notice that there are 10 of calls
Sep 10, 2013 12:50
//Categories
$cats = new Cats();
$cats_x = $cats->fetchCats();

//TOP
$posts_ho = new Posts_ho();
$posts_hox = $posts_ho->fetchPosts_ho();

//SUB 3
$posts_hoa = new Posts_hoa();
$posts_hoax = $posts_hoa->fetchPosts_hoa();

//SUB 3 MO
$posts_hoam = new Posts_hoam();
$posts_hoamx = $posts_hoam->fetchPosts_hoam();

//BOTOM
$posts_hi = new Posts_hi();
$posts_hix = $posts_hi->fetchPosts_hi();

//BOTOM SUB 3
$posts_hia = new Posts_hia();
$posts_hiax = $posts_hia->fetchPosts_hia();

//Galeries
$galsx = new Galsx();
Sep 10, 2013 12:50
this is the index file
Sep 10, 2013 12:48
this is the whole core file
Sep 10, 2013 12:47
class Core {
protected $db, $result;
private $rows;

public function __construct(){
$this->db = new mysqli('');
$this->db->set_charset('utf8');
}

public function query ($sql){
$this->result = $this->db->query($sql);
}

public function rows(){
for($x =1; $x<= $this->db->affected_rows; $x++){
$this->rows[] = $this->result->fetch_assoc();
}
return $this->rows;
}
}
Sep 10, 2013 12:47
@RoyalBg I don't get any errors, just empty area where data should be
Sep 10, 2013 12:47
@RoyalBg how do I do that?
Sep 10, 2013 12:47
@FDL I'm not sure I understand, but I don't think I do, It is a simple PHP code (in several files). One interacts with DB, others use the data.. (but only up to 9 times)
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Sep 10, 2013 12:58
but i need seperate arrays
Sep 10, 2013 12:45
help please, does anyone knows if there's some limits for number of calls of public fetch functions?? i can call it only 9 times, the 10th doesn't work
Aug 2, 2013 19:57
@Orangepill ok thank you, i'll try it emediatelly
Aug 2, 2013 19:49
grrr. I'm busting my balls all day on this
Aug 2, 2013 19:49
(hope I explained it better here)
Aug 2, 2013 19:49
0
Q: How to pass variable value to another file via class'

uollaaI have my main (user visible) file which displays posts, and I need to set-up pagination. It would be easy if I fetch DB in the same file (but I want to avoid that), that is why I created a seperate (user hidden) file which contains class' which are then called from main file(blog.php): BLOG.ph...

Aug 2, 2013 19:49
yes
Aug 2, 2013 19:45
problem: i cannot seem to return variable value, only query result (rows)
Aug 2, 2013 19:44
(after that file has been required ofcourse)
Aug 2, 2013 19:44
$posts_b = new Posts_b();
$posts_bx = $posts_b->fetchPosts_b();
Aug 2, 2013 19:44
and then get called from blog.php like:
Aug 2, 2013 19:44
(the query results, return with: return $this->rows()
Aug 2, 2013 19:43
to my blog.php file