I am using the following code to find whether the content area is using a command (commands are held in a table column) or not. The commands call on "quick content" which are default areas that you might see regularly around the site.

This feature ensures they are not different or irregular each time and all changes made to the row will reflect on all pages calling it.

$areain = "$styles[area2]";
$tables = mysql_query("SELECT * FROM `quick_content` WHERE `quickref`='$areain'");
$fetch = mysql_fetch_array($tables);
$frows = mysql_num_rows($tables);
$area = $fetch[quickref];
<? echo"$fetch[area]"; ?>
<? }else{ ?>
<?php eval('?>' . $styles[area2] . '<?php '); ?>
<? } ?>

My problem is with:
$areain = "$styles[area2]";

the code works on the page and area using the command. This also executes/echo's the content being requested although on the pages that do not call the command I get the following error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/habbonow/public_html/V4/index.php on line 274

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/habbonow/public_html/V4/index.php on line 275

I have tried:

$areain = '$styles[area2]';

This causes the command not to be executed and therefore it just shows the command (e.g. %contactus)

Any help would be appreciated
Thank you in advance!

Edited by digital-ether: Do use clear and relevant titles for new threads

7 Years
Discussion Span
Last Post by happytogether

I tried this and it does execute the code although it still causes the fetch errors on the other pages..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.