hm weird

Status
Not open for further replies.

bradleyx

Member
Messages
108
Reaction score
1
Points
18
Allowed memory size of 67108864 bytes exhausted (tried to allocate 4294967296 bytes) in pages/clan.php on line 14.
its the same as on my about page
never comes up with other pages that i used the same way of gathering data from mysql base.

for some reason the server keeps timing out when trying to connect to the database or runs out of memory which i don't know why it was working just fine yesterday and the day before
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
I have no idea what exactly that page is attempting to do, but when it says "tried to allocate 4294967296 bytes" it's trying to allocate 4GB of ram. That's an exceptionally large amount of memory for a script, even a poorly coded one. What is that page supposed to be doing exactly?
 

bradleyx

Member
Messages
108
Reaction score
1
Points
18
for some reasonapparently it was the mysql class i was using. it was my about page n the clan page was my clan member's page. it would connect to mysql gather data n then show it to the member/guest. but it wasnt working. i had to switch from the mysql class to a better way to connect. i am using a framework but it apparently can't seem to work right with to many fields selected.

http://crimsonminecraft.pcriot.com//about//

this is my page its giving me.

the part you see the about is the old way of connecting (which isn't really a good way.)
old way (works)
Code:
$result = mysql_query("SELECT * FROM sadmin_about ");
while($row = mysql_fetch_array($result))

  {
      
    
$id = $row['id'];
  $title=$row['title'];
  $body=$row['body'];
  

echo' <title>'.$title.' &bull; B3rs3k3rs </title>';
echo'
<div class="cnt-box">
  <div class="cnt-boxTop">'.$title.'</div>
  <div class="cnt-boxFiller">
    <div class="cnt-boxInfo">
 '.$body.'
</div>
  </div>
  <div class="cnt-boxFoot">
  <div class="author">Xensor</div>
  </div>
  </div>
  </div>';
    
     }
     mysqli_close($con);
the part with the error is the newer way ( using the frameworks)
newer way (doesn't work). used in the framework but it won't work when i try to set it up for retriving data from this table.

it works for my menu on the upper bar. but won't retrive my about or any other data.
Code:
$stmt = $mysqli->prepare("SELECT * FROM sadmin_about LIMIT 0, 7");
$stmt->execute();
$stmt->bind_result($id,$name,$url );
echo'<ul>';
while ($stmt->fetch()){
  array('title' => $name, 'body'=>$url, 'id'=>$id);

  echo "".$name."
".$url."";
}
$stmt->close();

they both would give same results


i don't much of a type of person that likes allot of coding.
 
Last edited:

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
This would be a scripting issue as opposed to a problem with the server (it's failing because the code is trying to allocate several times more ram than any normal script would actually need to load a page); I'd recommend contacting the support team for the framework you're using and inquire as to why it would attempt to allocate 4GB of ram.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
A. Is it still giving that error?

B. If the message says in "pages/clan.php on line 14." then,
1) open pages/clan.php in the CodeEditor
2) Copy lines 10 thru 16
3) Post them here indicating clearly which is line 14 (or whatever the error message says)

You might also want to use phpMyAdmin to look at that particular table. How much data would that query return?
 

bradleyx

Member
Messages
108
Reaction score
1
Points
18
A. Is it still giving that error?

B. If the message says in "pages/clan.php on line 14." then,
1) open pages/clan.php in the CodeEditor
2) Copy lines 10 thru 16
3) Post them here indicating clearly which is line 14 (or whatever the error message says)

You might also want to use phpMyAdmin to look at that particular table. How much data would that query return?


this is the code that i used when it gave me the error.

it only does it with sadmin_clan and sadmin_about.
Code:
    //Retrieve settings
$stmt = $mysqli->prepare("SELECT * FROM sadmin_myths LIMIT 0, 5");   
$stmt->execute();
$stmt->bind_result($id, $name, $value);

while ($stmt->fetch()){
$war = array('id' => $id, 'title' => $name, 'body' => $value);
echo '
  <div class="cnt-box">
  <div class="cnt-boxTop"><font color="#FF0000"><strong>Myth</strong></font> '.$name.'</div>
  <div class="cnt-boxFiller">
  <div class="cnt-boxInfo">
     <p>
'.$value.'
</p>
</div>
  </div>
  <div class="cnt-boxFoot">
  <div class="author">'.$name.'</div>
  </div>
  </div>
';


}

$stmt->close();


for about me page:

Code:
html format:
<div style="width:80%; word-wrap: break-word">B3rs3k3rs are a clan that loves to play games. We really don't care what game it is. We will play it<br><br>we are the B3rs3k3rs. We are a community of gamers that just loves to play games. anytype of games. minecraft, rpg, fps. if we can find it and get use to it we will play it. we do not allow hackers.</div>
viewed on screen:
B3rs3k3rs are a clan that loves to play games. We really don't care what game it is. We will play it

we are the B3rs3k3rs. We are a community of gamers that just loves to play games. anytype of games. minecraft, rpg, fps. if we can find it and get use to it we will play it. we do not allow hackers.

the clan page would just show my clan members in a definition list style format.

clan page:

html:
<dl class="border-around"><dt>bradley75</dt><dd>Rank: <img src="http://crimsonminecraft.pcriot.com/images/ssgt3.gif" title="bradley75"/><br /> Member: <a href="http://crimsonminecraft.pcriot.com/members/1/">bradley75</a><br /> Recruited: Mar 31, 2014 </dd>
</dl>

see on page:
xensor12
Rank:
pvtf.gif

Member: xensor12
Recruited: Apr 01, 2014



i am using the old code til i can figure out something better.

i am using usercake v2.0.2 its a membership management framework. it was the only one i could find that would work with the server the one i really want needs php 5.5 or higher and last time i checked we didn't have that error.
i was using the usercake's mysql connection ways but the way i use to seems to work better.
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
it only does it with sadmin_clan and sadmin_about.
Code:
    //Retrieve settings
$stmt = $mysqli->prepare("SELECT * FROM sadmin_myths LIMIT 0, 5");

If it does it with X, why are you posting different code?
The error message states the line number where the error is happening. If you refuse to indicate which line of code that is, I cannot help.
 

bradleyx

Member
Messages
108
Reaction score
1
Points
18
the reason i posted the whole code to the old one is cause the error code line is different then what shows in my php editor.

it says line 14 on clan page when i look on the editor its a blank line.
Code:
$stmt = $mysqli->prepare("SELECT * FROM sadmin_myths LIMIT 0, 5"); 
$stmt->execute(); 
$stmt->bind_result($id, $name, $value);

i found out its one of these 3 lines tho that is causing it the most.

but go ahead and mark this as solved as i found a better way of doing it.

i found a class that allows me to use 3 lines to connect, show and also update the records when needed.
 
Status
Not open for further replies.
Top