1

(4 replies, posted in Programming)

Yeah I know it's saying that... But what to do ?

2

(4 replies, posted in Programming)

Okay progress!

Fatal error: Call to undefined function: result() in c:\appserv\www\coh\include\viewthread_header.php on line 52

3

(4 replies, posted in Programming)

Hello!
I have a problem here, I'm trying to integrate punBB into my website.
So, I have this viewthread.php where you can see a thread/topic and comment.

Header thingy:
...

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO pbb_posts (poster, poster_id, poster_ip, poster_email, message, posted, topic_id) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['poster'], "text"),
                       GetSQLValueString($_POST['poster_id'], "int"),
                       GetSQLValueString($_POST['poster_ip'], "text"),
                       GetSQLValueString($_POST['poster_email'], "text"),
                       GetSQLValueString($_POST['message'], "text"),
                       GetSQLValueString($_POST['posted'], "int"),
                       GetSQLValueString($_POST['topic_id'], "int"));

  mysql_select_db($database_sql, $sql);
  $Result1 = mysql_query($insertSQL, $sql) or die(mysql_error());
  
  // Count number of replies in the topic
  $result = mysql_query("SELECT COUNT(id) FROM pbb_posts WHERE topic_id='$_GET[thread]'") or error('Unable to fetch post count for topic');
  $num_replies = result($result, 0) - 1;

  // Update topic
  $now = time();
  mysql_query("UPDATE pbb_topics SET num_replies = '$num_replies', last_post = '$now', last_post_id = '7', last_poster = '$_POST[poster]' WHERE id='$_GET[thread]'") or error('Unable to update topic');

  $insertGoTo = "viewposted.php?thread=".$row_Recordset1['id'];
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

...

Body thingy:
...

 <form name="form1" method="POST" action="<?php echo $editFormAction; ?>">
    <table width="526" cellspacing="0" cellpadding="0">
      <tr>
        <td height="12" background="grafik/contentbigstart.jpg"></td>
      </tr>
      <tr>
        <td background="grafik/contentbigmiddle.jpg"><table width="526" cellspacing="0" cellpadding="0">
            <tr>
              <td width="7" rowspan="4"></td>
              <td colspan="2"><span class="style3">Skriv kommentar 
                <input name="poster" type="hidden" id="poster" value="frac">
                <input name="poster_id" type="hidden" id="poster_id" value="2">
                <input name="poster_ip" type="hidden" id="poster_ip" value="127.0.0.1">
                <input name="poster_email" type="hidden" id="poster_email" value="caspar@onlajn.dk">
                <input name="posted" type="hidden" id="posted" value="<?php echo time(); ?>">
                <input name="topic_id" type="hidden" id="topic_id" value="<?php echo $_GET['thread']; ?>">
              </span></td>
              <td width="7" rowspan="4"></td>
            </tr>
            <tr>
              <td colspan="2" class="style4"><textarea name="message" rows="10" id="message" style="width: 98%;"></textarea></td>
            </tr>
            <tr>
              <td colspan="2" class="style4"><input type="submit" name="Submit" value="Kommenter">
              <input type="reset" name="Submit2" value="Ryd felt"></td>
            </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td height="12" background="grafik/contentbigbottom.jpg"></td>
      </tr>
    </table>
    
    <input type="hidden" name="MM_insert" value="form1">
</form>

...

When I try to make a post, it says:

Column count doesn't match value count at row 1

Please help? sad
/frac