EchoFool Posted December 23, 2009 Share Posted December 23, 2009 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 ! Quote Link to comment Share on other sites More sharing options...
jskywalker Posted January 16, 2010 Share Posted January 16, 2010 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; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.