Jump to content

Recommended Posts

Hey,

 

I use a phpbb forum and their php scripts are soooo complicated, they don't make life easy at all to implement.... im trying to make a link appear if a certain aspects are met based on a  query which is this:

 

//other stuff
<?php
include($phpbb_root_path . 'includes/db/mysql.' . $phpEx);
$db = new dbal_mysql();
$Var = $_postrow_val['POST_ID'];
$sql = $db->sql_query("SELECT *
        FROM phpbb_posts
        WHERE post_id = '$Var' 
        AND (forum_id='2' OR forum_id='36' OR forum_id='37' OR forum_id='39' OR forum_id='41' or forum_id='113' OR forum_id='52' 
        OR forum_id='76' OR forum_id='40' OR forum_id='43') LIMIT 1") or die(mysql_error());

If(mysql_num_rows($sql)>0){
?>
        <br><br><br><a href="assistance.php?p=<?php echo $_postrow_val['POST_ID'];?>">[REQUEST ASSISTANCE]</a>
<?php
    }
?>

 

But my "or die" kills my script with no error message =/ Any one familiar with phpbb to know what i got wrong? This is in the prosilve view topic script.

 

I asked on phpbb but they taken so far a month+ to reply so far !

Link to comment
https://forums.phpfreaks.com/topic/186097-forum-phpbb-issue/
Share on other sites

  • 4 weeks later...

do not do:

or die(mysql_error());

but try:

or die(echo mysql_error());

 

Because mysql_error() terurns a string with a description of the MySQL-error..

or,

take a look in your errorlog (if that's enabled for Mysql)

 

BTW your query could also been writen as:

SELECT *  FROM phpbb_posts WHERE post_id = '$Var' AND forum_id IN ('2','36','37','39','41','113','52','76','40','43') LIMIT 1;

Link to comment
https://forums.phpfreaks.com/topic/186097-forum-phpbb-issue/#findComment-996089
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.