Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    problema inconsueto con un warning

    Salve a tutti

    non sono un esperto di php, ma mi hanno dato degli script facilmente utilizzabili e quindi mi sto cimentando....

    facendo dei test su un mio sito, riscontro uno strano errore, per la precisione un warning di questo tipo

    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /web/htdocs/www.mollyjones.net/home/cb/index2.php on line 187


    l'indirizzo provvisorio su cui sto effettuando i test (indirizzo di mia proprietà su aruba) è il seguente:

    www.mollyjones.net/cb

    La cosa strana è che lo stesso script funziona correttamente sul sito principale (www.mollyjones.net)

    vi posto anche il codice php contenuto nella pagina in questione:


    <?
    require("manager1/config.php");

    $connection = mysql_connect($dbhost, $dbusername, $dbpassword);

    $cShowMax = 5;

    ?>

    <?

    $content = mysql_db_query($dbname, "select n.*, c.descrizione from newscontent n, categorie c

    where n.id_categoria = c.id and (n.id_categoria=1 or n.id_categoria=2 or n.id_categoria=3 or n.id_categoria=4 or n.id_categoria=5)order by n.event desc");

    $Xcontent = mysql_fetch_array($content);

    if (($cShowMax == "999") OR ($cShowMax>=mysql_num_rows($content)))

    {
    $cShowMax = mysql_num_rows($content);
    }

    for ($y=1; $y<=$cShowMax; $y++)

    {
    $categ = strtoupper($Xcontent["descrizione"]);

    $title = stripslashes($Xcontent["title"]);
    $descrizione = stripslashes($Xcontent["news"]);
    $caratteri=70;
    if (strlen($descrizione) >= $caratteri) {
    $descrizione = substr($descrizione, 0, $caratteri);
    $posLastSpace = strrpos($descrizione, " ");
    $descrizione = substr($descrizione, 0, $posLastSpace);
    $descrizione = $descrizione."...";
    }

    $date = date("d/m/Y", strtotime($Xcontent["event"]));

    $id = $Xcontent["id"];

    echo "<table width=\"100%\" border=\"0\" valign=\"center\" bgcolor=\"f7f7f7\" cellspacing=\"0\" cellpadding=\"0\">";

    echo "<tr>";

    echo "<td bgcolor=\"f7f7f7\">";

    echo "<div align=\"left\">";

    echo "<font color=\"000000\" face=Verdana, Arial, Helvetica, sans-serif size=1>";

    echo "$date";

    echo "<font color=#333333 face=Arial, Helvetica, sans-serif size=1>";

    echo $descrizione."<a href=\"javascript:Zoom('modifica','modifica','dett agli_ne ws.php?id_news=".$id."');\"><img src=\"obj/leggitutta.gif\" border=\"0\"></a>
    </td>";

    echo "</td>";

    echo "</tr>";

    echo "<tr>";
    echo "<td><img src=\"obj/linea-gialla.gif\" width=\"100%\" height=\"5\">";
    echo "</td>";
    echo "</tr>";

    echo "</table>";

    $Xcontent = mysql_fetch_array($content);

    }



    mysql_free_result($content);


    ?>



    potreste gentilmente dirmi quale potrebbe essere il problema?

    grazie 1000
    Il Rugby è la poesia del sacrificio!

  2. #2
    $connection = mysql_connect($dbhost, $dbusername, $dbpassword) or die( mysql_error() );

    ...

    $content = mysql_db_query($dbname, "select n.*, c.descrizione from newscontent n, categorie c

    where n.id_categoria = c.id and (n.id_categoria=1 or n.id_categoria=2 or n.id_categoria=3 or n.id_categoria=4 or n.id_categoria=5)order by n.event desc") or die( mysql_error() );
    Formaldehyde a new Ajax PHP Zero Config Error Debugger

    WebReflection @WebReflection

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.