The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Urgent Mysql error

Discussion in 'General Discussion' started by ekaram, Mar 5, 2004.

  1. ekaram

    ekaram Member

    Joined:
    Feb 21, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I just moved from Ensim, and I'm getting a lot of errors like these on scripts that were working perfectly well:

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/site/public_html/admon/altas.php on line 98

    Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/site/public_html/admon/altas.php on line 116

    Line 98: while ($row=mysql_fetch_array($result)){
    Line 116: mysql_free_result($result);

    Please, any help would be appreciated.

    Thanks.
     
  2. xfsunoles

    xfsunoles Member

    Joined:
    Mar 6, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    do you have $result near those line?
     
  3. ekaram

    ekaram Member

    Joined:
    Feb 21, 2004
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    no, not at all.

    This is the cluster:

    <?
    $CuentaCols=1;
    $CuentaRow=0;
    $RSSubS = mysql_query("SELECT * FROM ContProductos where IdCategoria = $IdCategoriaPDD",$link);
    $myrow = mysql_fetch_array($RSSubS);
    $num_rows = intval(mysql_num_rows($RSSubS));
    If ($num_rows>0) {
    do {
    $IdItemDD = trim($myrow["IdItem"]);
    $ProdDD = trim($myrow["NombreProd"]);
    $ImagenDD = trim($myrow["Imagen"]);

    if ($CuentaCols==1) {
    echo "<tr>";
    }
    ?>
    <td>&nbsp;</td>
    <td width="133" valign="top" class="parrafo"> <p align="center">
    <? if ($ImagenDD!="NA") { ?><a href="VerProducto.php?IdCatPP=<?= $IdCatP?>&IdCatP=<?= $IdCategoriaPDD ?>&Prod=<?= $IdItemDD ?>"><img src="UpImg/<?= $ImagenDD ?>" border="0"></a><br><? } ?>
    <span class="parrafo"><a href="VerProducto.php?IdCatPP=<?= $IdCatP ?>&IdCatP=<?= $IdCategoriaPDD ?>&Prod=<?= $IdItemDD ?>" class="parrafo3"><?= $ProdDD ?></a> </span></p>
    </td>
    <?
    if (($CuentaCols==3) or ($CuentaRow==$num_rows-1)) {
    echo "</tr>\n"
    ."<tr>\n"
    ." <td height=\"3\" colspan=\"4\"><img src=\"../img/1trasp.gif\" width=\"1\" height=\"25\"></td>"
    ."</tr>";
    }
    $CuentaCols = $CuentaCols +1;
    $CuentaRow = $CuentaRow +1;
    ?>
    <?
    } while ($myrow = mysql_fetch_array($RSSubS));
    } else {
    echo "<tr>\n"
    ." <td height=\"3\" colspan=\"4\"><img src=\"../img/1trasp.gif\" width=\"1\" height=\"25\"></td>"
    ."</tr>";
    }
    mysql_free_result ($RSSubS);
    } while ($myrow = mysql_fetch_array($RSCat));
    }
    mysql_free_result ($RSCat);
    ?>

    This was working perfectly on my ensim server.
     
  4. xfsunoles

    xfsunoles Member

    Joined:
    Mar 6, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    it was looking $result.
     
Loading...

Share This Page