Note that there are some explanatory texts on larger screens.

plurals
  1. POFunction and Code are not passing through variables properly. Somewhat of a debugging request in a twitter-like system code
    primarykey
    data
    text
    <p>For some reason the form data is not being passed through properly in a function that I have used from <a href="http://www.ibm.com/developerworks/opensource/library/os-php-twitter-interface/index.html#author1" rel="nofollow">http://www.ibm.com/developerworks/opensource/library/os-php-twitter-interface/index.html#author1</a></p> <p>I am not sure if I am using implode correctly. If you notice though, I did change some values in the tutorial because I just felt that they seemed incorrect. Just go ahead and let me know what I should change. Right now, profile.php comes up and no posts show up. However, the databases are getting all of the posts perfectly.</p> <p><strong>There are no error messages... Something just isn't being passed through properly.</strong></p> <p>I am at the last part of the tutorial. My Code that is on index\profile.php:</p> <pre><code> &lt;!-- Shows posts on page--&gt; &lt;?php $posts = show_posts($_SESSION['userid']); if (count($posts)){ ?&gt; &lt;table border='1' cellspacing='0' cellpadding='5' width='500'&gt; &lt;?php foreach ($posts as $key =&gt; $list){ echo "&lt;tr valign='top'&gt;\n"; echo "&lt;td&gt;".$list['user_id'] ."&lt;/td&gt;\n"; echo "&lt;td&gt;".$list['body'] ."&lt;br/&gt;\n"; echo "&lt;small&gt;".$list['stamp'] ."&lt;/small&gt;&lt;/td&gt;\n"; echo "&lt;/tr&gt;\n"; } ?&gt; &lt;/table&gt; &lt;?php }else{ ?&gt; &lt;p&gt;&lt;b&gt;You haven't posted anything yet!&lt;/b&gt;&lt;/p&gt; &lt;?php } ?&gt; </code></pre> <p>And this is the code in functions.php:</p> <pre><code>function show_posts($userid,$limit=0){ $posts = array(); $user_string ="'" .implode("','", $posts). "'"; $extra = " and id in ($user_string)"; if ($limit &gt; 0){ $extra = "limit $limit"; }else{ $extra = ''; } $sql = "select user_id, body, stamp from posts where user_id='$user_string' order by stamp desc $extra"; //echo $sql; $result = mysql_query($sql); while($data = mysql_fetch_object($result)){ $posts[] = array( 'stamp' =&gt; $data-&gt;stamp, 'user_id' =&gt; $data-&gt;user_id, 'body' =&gt; $data-&gt;body ); } return $posts; </code></pre> <p>}</p>
    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.
    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