MyBB Community Forums

Full Version: fetch only returning 6 rows??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello I want to read the whole smilie table for my plugin but it only gives me 6 rows back with the fetch is there a limit defined somewhere and can I increase it or??
Unless you defined it. Mention your code/query.
Quote:$queryGetS = $db->query("SELECT * FROM ".TABLE_PREFIX."smilies");
while($smilies = $db->fetch_array($queryGetS))
Try this:

$queryGetS = $db->query("SELECT * FROM ".TABLE_PREFIX."smilies" Limit 0,20);
while($smilies = $db->fetch_array($queryGetS))

Change the number 20 to the amout you want to limit.
(2013-03-24, 02:31 PM)Jambuster Wrote: [ -> ]Try this:

$queryGetS = $db->query("SELECT * FROM ".TABLE_PREFIX."smilies" Limit 0,20);
while($smilies = $db->fetch_array($queryGetS))

Change the number 20 to the amout you want to limit.

I will try it but I want it limitless...

Edit1: doesn't work... still 6..
Your original query has no limit. Make sure you actually have more than 6 smilies.
That's where the problems is... the table has 20 rows... so why is it returning 6???
Show me the entire code your using to return the results.
Here:

Quote: if($form_container->_title == $lang->misc)
{
$queryGetS = $db->query("SELECT * FROM ".TABLE_PREFIX."smilies");
while($smilies = $db->fetch_array($queryGetS))
{
$smilieBox = array();
for($i = 0; $i < count($smilies); $i++)
{
array_push($smilieBox, $form->generate_check_box("smilie", 1, "<img src='".$mybb->settings['bburl']."/".$smilies[image]."' boder='0' /> Can use this smilie?", array("checked" => $mybb->input['sid_allowed'])));
}
}

$usergroup_smilie_options = $smilieBox;
$form_container->output_row("Smilies", "", "<div class=\"usergroup_smilie_bit\">".implode("</div><div class=\"usergroup_smilie_bit\">", $usergroup_smilie_options)."</div>");
}

It's still unfinished but it should at least return the number of results.
Do this:

$queryGetS = $db->query("SELECT * FROM ".TABLE_PREFIX."smilies");
while($smilies = $db->fetch_array($queryGetS)) {
	$result .= ' <img src="'.$smilies['image'].'">';
}

echo $result;
Pages: 1 2