Note that there are some explanatory texts on larger screens.

plurals
  1. POmysqli_num_rows() expects parameter 1 to be mysqli_result
    primarykey
    data
    text
    <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/11674312/warning-mysql-fetch-expects-parameter-1-to-be-resource-boolean-given-error">Warning: mysql_fetch_* expects parameter 1 to be resource, boolean given error</a> </p> </blockquote> <p>I receive this error:</p> <pre><code>Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /Applications/MAMP/htdocs/start-fbook/facebook.php on line 113 </code></pre> <p>Here's the code. When I submit the "status", it will be saved in my database, so there's nothing wrong with that part. </p> <pre><code>&lt;?php //Eerst bouwen we onze applicatie uit zodat ze werkt, ook zonder JavaScript include_once("classes/Activity.class.php"); $activity = new Activity(); //controleer of er een update wordt verzonden if(!empty($_POST['activitymessage'])) { $activity-&gt;Text = $_POST['activitymessage']; try { $activity-&gt;Save(); } catch (Exception $e) { $feedback = $e-&gt;getMessage(); } } //altijd alle laatste activiteiten ophalen $recentActivities = $activity-&gt;GetRecentActivities(); ?&gt;&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;IMDBook&lt;/title&gt; &lt;link href="css/reset.css" rel="stylesheet" /&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt; &lt;style type="text/css"&gt; body { font-family: "Lucida Grande", Tahoma, Verdana, sans-serif; } h1 { margin-bottom: 5px; } h2 { color: #3b5998; display: inline; } ul { margin-top: 10px; } ul li { border-bottom: 1px dotted #fff; padding: 15px 5px; } #activitymessage { border: 1px solid #bbbbbb; padding: 5px; width: 280px; font-size: 1.1em; } div.statusupdates { width: 380px; background-color: #ccc; padding: 20px; margin: 0 auto; } #btnSubmit { background-color: #627aac; color: #fff; font-size: 1.1em; border: 1px solid #29447e; } div.errors { width: 380px; margin: 25px auto; background-color: #bd273a; -moz-border-radius: 10px; color: white; font-weight: bold; text-shadow: 1px 1px 1px #000; padding: 20px; display:none; } &lt;/style&gt; &lt;script type="text/javascript"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;div class="errors"&gt;&lt;/div&gt; &lt;form method="post" action=""&gt; &lt;div class="statusupdates"&gt; &lt;h1&gt;GoodBytes.be&lt;/h1&gt; &lt;input type="text" value="What's on your mind?" id="activitymessage" name="activitymessage" /&gt; &lt;input id="btnSubmit" type="submit" value="Share" /&gt; &lt;ul id="listupdates"&gt; &lt;?php if(mysqli_num_rows($recentActivities) &gt; 0) { while($singleActivity = mysqli_fetch_assoc($recentActivities)) { echo "&lt;li&gt;&lt;h2&gt;GoodBytes.be&lt;/h2&gt; ". $singleActivity['activity_description'] ."&lt;/li&gt;"; } } else { echo "&lt;li&gt;Waiting for first status update&lt;/li&gt;"; } ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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