Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP MySQL script gone wrong
    primarykey
    data
    text
    <p>I'm working on a site and created this experimental script which populates a category menu dynamically based on the database entry.</p> <p>It worked for a day and then suddenly stopped. I changed my includes for requires and it gave me this error message</p> <blockquote> <p>Fatal error: Maximum execution time of 30 seconds exceeded in /home1/advertbo/public_html/dev_area/origocloud/include/views/blog/dbget.php on line 34</p> </blockquote> <pre><code>function getBlogMenu(){ $dbhost = 'localhost'; $dbuser = ' '; $dbpass = ' '; $con = mysql_connect($dbhost, $dbuser, $dbpass); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("ado_ocblog", $con); $htmlString = ""; $result = mysql_query( "SELECT * FROM subCat JOIN headCat ON subCat.headid = headCat.id ORDER BY headid ASC;"); $array = mysql_fetch_array($result); mysql_close($con); $pre = NULL; $hc = 0; $sc = 1; while ($array) { if($pre == NULL){ $pre = $row["headc"]; $test[0][0]=$row["headc"]; $test[0][1]=$row["subc"]; } else { if($pre ==$row["headc"]){ $sc++; $test[$hc][$sc] = $row["subc"]; } else { $hc++; $sc = 1; $test[$hc][0]=$row["headc"]; $test[$hc][$sc]=$row["subc"]; $pre = $row["headc"]; } } } foreach( $test as $arrays=&gt;$cat) { $first = TRUE; foreach($cat as $element) { if($first == TRUE) { $htmlString.= '&lt;h3&gt;&lt;a href=""&gt;'.$element.'&lt;/a&gt;&lt;/h3&gt; &lt;div&gt; &lt;ul&gt; '; $first = FALSE; } else { $htmlString.= '&lt;li&gt;&lt;a class="sub_menu" href="#"&gt;'.$element.'&lt;/a&gt;&lt;/li&gt;'; } } $htmlString.= '&lt;/ul&gt; &lt;/div&gt;'; } return $htmlString; } </code></pre> <p>I'm really stuck, the page just keeps timing out the point where i call the function</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload