Hello there,

I'm trying to develop a facebook application that fetches rows from a mysql database by rand(). It worked, however on the the profile box it doesn't change on refresh as facebook caches everything so you'll have to visit the app page in order to get a new row. So, I'm trying to create a button on the profile page that sends you to refresh.php and that files redirects you to the user's profile. But also, it's not working. The button is showing up but not the row.

Here is the code, please try to help me!

PHP Code:

// the facebook client library
include_once 'client/facebook.php';

// some basic library functions
include_once 'lib.php';

// this defines some of your basic setup
include_once 'config.php';

$facebook = new Facebook($api_key$secret);
$user $facebook->require_login();

if (!
function_exists("GetSQLValueString")) {
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;

$query_Recordset1 "SELECT data FROM data ORDER BY rand()";
$Recordset1 mysql_query($query_Recordset1$conbb) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);
<style type="text/css">
.style1 {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 12px;

<div style="padding: 10px;">
  <p class="style1"><?php // echo $row_Recordset1['data']; 
echo $row_Recordset1['data']; ?></p>
  <div style="clear: both;"/>
    <form id="form1" name="form1" method="post" action="">
      <input type="submit" name="data" id="data" value="Refresh" onclick="http://symbioagency.com/rokoz/insults/index.php" />
"<fb:editor action=\"refresh.php\"><fb:editor-buttonset><fb:editor-button name=\"refresh\" value=\"Refresh\"/></fb:editor-buttonset></fb:editor>";
$facebook->api_client->profile_setFBML($fbml$row_Recordset1); ?>
As you see
PHP Code:
$fbml "<fb:editor action=\"refresh.php\"><fb:editor-buttonset><fb:editor-button name=\"refresh\" value=\"Refresh\"/></fb:editor-buttonset></fb:editor>";
$facebook->api_client->profile_setFBML($fbml$row_Recordset1); ?> 
These are the the things that show up on the profile box, however the $row_Recordset1 is not appearing and if I remove $fbml it will show.