WordPress.org

Ready to get started?Download WordPress

Forums

MySQL Numrows error when combining scripts (4 posts)

  1. angelbloom
    Member
    Posted 8 years ago #

    I use a script from http://www.codegrrl.com called flinx. I have integrated it into my wordpress using the following tag at the top of my page:


    <?php
    require('/home/username/public_html/wordpress/wp-blog-header.php');
    ?>
    <?php get_header(); ?>

    that code integrates the layout. however when i go to a category in the flinx collective, such as

    http://www.fractured-beauty.net/flinx/category.php?id=6

    i get this error:

    Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/fbeauty/public_html/flinx/category.php on line 37

    and a few others. i have done what i was told by http://codegrrl.com/faq/scripts_flinx_troubles/mysql_numrows_error_when_combining_scripts.php by adding all of the correct absolute paths to any other includes given but i keep getting the error.

    the error goes away when i delete the first tag that includes wordpress (which pretty much defeats the entire purpose of integrating...) maybe it is something in wp-blog-header. if so, then what is it? my wp-blog-header.php is the same as it was when i downloaded it.

    here is the complete code for category.php (the file causing the errors):


    <?php
    require('/home/fbeauty/public_html/wordpress/wp-blog-header.php');
    ?>
    <?php get_header(); ?>

    <?
    #
    # Flinx 1.3
    # Copyright 2003 Bonnie and Sasha. All rights reserved.
    # http://www.codegrrl.com/
    #
    # Released June 29th 2003
    #
    # Flinx 1.3 is linkware and can be used or modified as long as this note remains intact
    # and unaltered and you provide a link back to http://www.codegrrl.com/ in return. You
    # are forbidden to sell or distribute the code of Flinx 1.3, in whole or part, without
    # the written consent of Sasha & Bonnie.
    #
    # By using Flinx 1.3 you agree to indemnify Sasha & Bonnie from any liability.
    #
    # Please see http://www.codegrrl.com/ for further information.
    #

    include("/home/fbeauty/public_html/flinx/config.php");
    include("/home/fbeauty/public_html/flinx/header.inc");
    ?>

    <table align="center" width="60%" border="0" cellpadding="0" cellspacing="15">

    <tr>
    <td colspan="2" align="left" width="100%">

    <?
    $query="SELECT linkID FROM $table_link WHERE relCatID=$id";
    $queryl=mysql_query($query);
    $count=mysql_numrows($queryl);
    $result=mysql_query("SELECT name FROM $table_cat WHERE catID=$id");
    if ($row=mysql_fetch_array($result)){
    do{
    ?>

    <p align="left"><b><?=$row["name"]?></b>

    <p align="justify">Below you can view all <b><?=$count?></b> links in the <b><?=$row["name"]?></b> category. To view the subject of each individual site, please hover over the button.

    <?
    }while($row=mysql_fetch_array($result));
    }else {print "<p align=\"left\"><b>No such category!</b>";}
    ?>

    </td>
    </tr>

    <tr>
    <td width="100%">

    <p align="center">
    <?
    $result=mysql_query ("SELECT * FROM $table_link WHERE relCatID=$id ORDER BY name ASC");
    if ($row=mysql_fetch_array($result)){
    do{
    $width=$row["width"];
    $height=$row["height"];
    if ($width < 10){
    $insert_width = "";
    }else { $insert_width=" width=\"$width\"";}
    if ($height < 10){
    $insert_height = "";
    }else { $insert_height=" height=\"$height\"";}
    ?>
    " target="<?=$target?>"><img border="0" src="<?=$base_url?><?=$row["image"]?>" alt="<?=$row["name"]?>"<?=$insert_width?><?=$insert_height?>>
    <?
    }while($row = mysql_fetch_array($result));
    }else {print "This category is currently empty.";}
    ?>

    <p align="right">« back

    </td>
    </tr>

    </table>

    <?include("footer.inc");?>

    note: this error only appeared AFTER I upgraded from 1.5 to 1.5.2, maybe that's the problem?

  2. moshu
    Member
    Posted 8 years ago #

    What is "flinx" I cannot find on the site linked by you - maybe you could provide a direct link.
    However, I've found this: http://codegrrl.com/scripts/

  3. angelbloom
    Member
    Posted 8 years ago #

    here is the full link if you need it

    http://codegrrl.com/scripts/flinx/

  4. moshu
    Member
    Posted 8 years ago #

    OK, so it's a third-party script and we don't offer support for it in this forum. The author has a support forum http://codegrrl.com/forums/

    p.s. Please, do not post long code in the forum. Use http://pastebin.com or similar services.

Topic Closed

This topic has been closed to new replies.

About this Topic