Purchase Credits 2.0.1 released and NewPoints 2.1.2 released .
$db->fetch_array only showing one array

Currently I'm trying to use the following code to put out ALL entries in a certain database (within the "WHERE"). The problem is that it only puts out one value, one array, while I want it to return multiple arrays, with an array in it containing data as "uid", "name", etc.

I'm using the following code:
PHP Code:
function list_entries($raffle_start$raffle_end) {
                <prefix removed>_raffle_entries
                time > "
                time < "
            LIMIT 5"
$query $db->query($sql);
$entries = array();
$records $db->fetch_array($query)) {
$entries[] = $records;


It doesn't seem to work, atleast, it only returns one array:
Array (
[uid] => 1
[name] => Ruben
[time] => 1354366024
It should return:
Array (
[1] => Array (
[uid] => 1
[name] => Ruben
[time] => 1354366024  
[2] => Array (
[uid] => 2
[name] => Jordan
[time] => 1354366510
I'm sure these values exist in the database.

Fixed it, forgot to put $records = array(), but after I put that, refreshed the page, and then removed that line again, to show my dad what was wrong (I talk with him a lot about PHP), it still worked. Strange.
I see no reason for it to fail, may be you didn't save the file? Tongue Happens sometimes to me, editing a different file or not saving them..
Support PM's will be ignored. Exclamation
I did save the file multiple times. But my dreamweaver acts up once now and then.
Use some advance text editor, something like Notepadd++.
Support PM's will be ignored. Exclamation
I rather use Dreamweaver because it is more than just text.
Well, if you are writing MyBB friendly code then you shouldn't be using Dreamweaver, it doesn't work like that (again, if you are writing friendly code, i.e: You plan to release a plugin that is well written).
Support PM's will be ignored. Exclamation
What's the problem with Dreamweaver then?
Most people use DW because it generates HTML code. If you are writing plugins there is no point in using it, you need to stick to the templates.
To download our paid plugins and receive support you must be a paid subscriber. Click here for more information.
I'm just using it because I find it more useful than Notepad++ for HTML.

Users browsing this thread: 1 Guest(s)

About MyBB-Plugins

Plug Yourself into the best MyBB AddOn.

Copyright © 2009-2020 MyBB-Plugins Forums.


  • 51,000+ Posts
  • 19,000+ Members
  • 3,600+ Threads

Impressed? For sure
Check Full Stats here