Partage
  • Partager sur Facebook
  • Partager sur Twitter

Aider moi a propo de mysql

Sujet résolu
    7 juin 2007 à 15:27:29

    Poster 3fois mais toujours sans reponse!



    Bonjour,


    hey voila les problemes commence :)
    Jai un probleme de connexion a mon mysql ...
    Non je nutilise pas easyphp...
    je suis directement sur mon site
    voila le probleme
    jai ete dans les tutoriaux et dans le tutoriaux de site complet jai tester cela mais meme pas rendu a me connecter sur mysql ca block!
    voila mes code et quelques images!



    Voila les erreurs:


    http://joehou.hostingrapid.com/test/

    Quelque photo qui pourrait aider:
    http://img463.imageshack.us/my.php?image=problemedd5.jpg
    http://img463.imageshack.us/my.php?image=probleme2cc7.jpg

    Voila mes codes



    index.php
    <?php
    //Cette fonction doit être appelée avant tout code html
    session_start();

    //On donne ensuite un titre à la page puis on appelle notre fichier debut.php
    $titre = "Index du forum";
    include("includes/debut.php");
    ?>
    <body>
    <div id="banniere"></div>
    <?php
    //Maintenant on se connecte à la base de donnée
    include("includes/identifiants.php");
    mysql_connect($adresse, $nom, $motdepasse);
    mysql_select_db($database);
    ?>

    <div id="corps_forum">
    <?php
    // On indique où l'on se trouve
    echo'<a href ="./index.php">Index du forum</a>';

    // Puis on commence notre if

    if (isset($_SESSION['pseudo'])) // Si le membre est connecté
    {
            //Voici les options
            echo'<h2>Vous êtes connecté en tant que
            <a href="./voirprofil.php?m='
    .$_SESSION['id'].'&action=consulter">
            '
    .$_SESSION['pseudo'].'</a><br />
            <a href="./voirprofil.php?action=modifier">
            Modifier mon profil</a><br />
            <a href="./messagesprives.php">
            Consulter mes messages privés</a><br />
            <a href ="./deconnexion.php">Se déconnecter</a><br /></h2>'
    ;

    }


    // Sinon on propose de se connecter ou de s'enregistrer
    else
    {
            echo'<h2>Vous n êtes pas connecté <br />
            <a href="./connexion.php">Se connecter</a><br />
            <a href="./register.php">Pas encore inscrit ?</a><br /></h2>'
    ;
    }
    ?>
    <h1>Forum Exemple</h1><br /><br />
    <h2>

    <?php
    //Initialisation de deux variables
    $totaldesmessages = 0;
    $categorie = "";
    //Cette requete permet d'obtenir tout sur le forum
    $requete2 = mysql_query('
    SELECT cat_id, cat_nom,
    forum_forum.forum_id, forum_name, forum_desc, forum_post, forum_topic, auth_view, forum_topic.topic_id,
    post_time, post_createur, membre_pseudo,
    membre_id
    FROM forum_categorie
    LEFT JOIN forum_forum ON forum_categorie.cat_id = forum_forum.forum_cat_id
    LEFT JOIN forum_post ON forum_post.post_id = forum_forum.forum_last_post_id
    LEFT JOIN forum_topic ON forum_topic.topic_id = forum_post.topic_id
    LEFT JOIN forum_membres ON forum_membres.membre_id = forum_post.post_createur
    ORDER BY cat_ordre, forum_ordre DESC'
    );

    //Dans un premier temps on vérifie s'il y a des forums à lister
    if (mysql_num_rows($requete2) < 1)
    {
            echo'Il n y a pas de forum :o
            Allez en ajouter avec le panneau d administration'
    ;
    }
    else
    {
            //Début de la boucle
            while($data2 = mysql_fetch_assoc($requete2))
            {
            //On affiche chaque catégorie
            if( $categorie != $data2['cat_id'] )
            {
            //Si c'est une nouvelle catégorie on l'affiche
           
                    $categorie = $data2['cat_id'];
                    echo'
                    <table>
                           
                    <thead>
                    <tr>
                    <th></th>
                    <th id="titre"><strong>'
    .$data2['cat_nom'].'</strong></th>             
                    <th id="nombremessages"><strong>Sujets</strong></th>       
                    <th id="nombresujets"><strong>Messages</strong></th>       
                    <th id="derniermessage"><strong>Dernier message</strong></th>   
                    </tr></thead><tbody>   
                    '
    ;
             }

                    //Ici on met le contenu de chaque catégorie

                    // Ce super echo de la mort affiche tous
                    // les forums en détail : description, nombre de réponses etc...

                    echo'<tr><td><img src="./images/message.gif"></td>
                    <td id="titre"><strong>
                    <a href="./voirforum.php?f='
    .$data2['forum_id'].'">
                    '
    .$data2['forum_name'].'</a></strong>
                    <br />'
    .$data2['forum_desc'].'</td>
                    <td id="nombresujets">'
    .$data2['forum_topic'].'</td>
                    <td id="nombremessages">'
    .$data2['forum_post'].'</td>';

                    // Deux cas possibles :
                    // Soit il y a un nouveau message, soit le forum est vide
                    if (!empty($data2['forum_post']))
                    {
                            echo'<td id="derniermessage">'.date('H\hi \l\e d/M/Y',$data2['post_time']).'<br /><a href="./voirprofil.php?m='.$data2['post_createur'].'&action=consulter">'.$data2['membre_pseudo'].'  </a><a href="./voirtopic.php?t='.$data2['topic_id'].'"><img src="./images/go.gif"></a></td>';
                    }
                    else
                    {
                            echo'<td id="nombremessages">Pas de message</td>';
                    }
                   
                    echo'</tr>';

                    //Cette variable stock le nombre de message, on la met à jour
                    $totaldesmessages = $totaldesmessages + $data2['forum_post'];

                    //On ferme notre boucle et nos balises
            } //fin de la boucle
            echo'           
            </tbody>
            </table>
            '
    ;
    } //fin du else
    //Le pied de page ici :
    echo'
    <hr>
    <div>
    <h1>
    Qui est en ligne ?
    </h1>
    '
    ;


    $requete3 = mysql_query('
    SELECT membre_id 
    FROM forum_membres'
    );

    $TotalDesMembres = mysql_num_rows($requete3);

    $requete4 = mysql_query('
    SELECT membre_pseudo, membre_id
    FROM forum_membres
    ORDER BY membre_id DESC LIMIT 0, 1'
    );

    $data4 = mysql_fetch_assoc($requete4);
    $derniermembre = $data4['membre_pseudo'];

    //On a plus qu'à utiliser echo
    echo'<h2>Le total des messages du forum est <strong>'.$totaldesmessages.'</strong><br />';
    echo'Le site et le forum comptent <strong>'.$TotalDesMembres.'</strong> membres.<br />';
    echo'Le dernier membre est <a href="./voirprofil.php?m='.$data4['membre_id'].'&action=consulter">'.$derniermembre.'</a><br /></h2>';

    ?>
    </div>
    </div>
    </body>
    </html>




    sous dossier nommé "includes" on y retrouve debut.php et identifiants.php



    debut.php
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <head>
    <?php
    if (!empty($titre)) //Si le titre est indiqué on l'affiche entre les balises <title>
    {
        echo '<title> '.$titre.' </title>';
    }
    else //Sinon on écrit forum par défaut
    {
        echo '<title> Forum </title>';
    }
    ?>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="stylesheet" media="screen" type="text/css" title="Design" href="./css/design.css" />
    </head>



    indentifiants.php
    <?php
    //identifiants
    $adresse = 'localhost';
    $nom = 'joehou_joehou_';
    $motdepasse = '*****';
    $database = 'joehou_joehou_';
    ?>



    Plus le email de mon fournisseur et les information!


    Hello Joey,

    These are the login details that you will need to use:

    Dear Joey Houle,

    Thank you for choosing our services.
    This email contains important data about your web hosting account for www.tutoplanet.c.la.
    -------------------------------------------------
    Access the Control Panel here: http://hostingrapid.com/members/

    Login: joehou
    Password: ********
    -------------------------------------------------
    Your website will be accessible here: http://joehou.hostingrapid.com or if you use a domain name here: www.tutoplanet.c.la
    IMPORTANT!!!
    Please change the DNSes of your domain to the following and allow 24-48 hours for the DNS update:
    dns1.100ws.com
    dns2.100ws.com


    -------------------------------------------------
    EMAIL information:
    To create emails please login to the Control Panel and click 'E-mail Manager'.
    There you can see the mail server (incoming and outgoing) that you have to use.

    IMPORTANT - the SMTP server requires login and password. In Outlook select 'My server requires authentication'. In other email clients this option has a different name. STMP is not available for free hosting accounts.
    -------------------------------------------------
    FTP information:
    FTP Host: joehou.hostingrapid.com or www.tutoplanet.c.la
    Login: joehou
    Password: ******
    -------------------------------------------------
    To use the Front Page extensions select 'Front Page extensions' from the Control Panel and manage the extensions.
    -------------------------------------------------

    If you use our services for the first time, please see the beginner's guide in our support forum: http://forum.100webspace.com/viewtopic.php?t=4554

    If you have any questions please login to the Control Panel and click Help Center (located under the 'Support' link). If you do not find your answer there feel free to open a new ticket and our 24/7 support will answer you shortly.

    Best Regards
    100 Web Space Team


    Best Regards,
    Andy
    Support@100webspace.com
    http://www.100webspace.com/

    ----------------------

    FTP host: tutoplanet.c.la or joehou.hostingrapid.com
    User: joehou
    Password: ******
    Port: 21
    • Partager sur Facebook
    • Partager sur Twitter
      7 juin 2007 à 15:56:29

      Aparemment ce n'est pas de ta faute:

      Citation : forum

      Warning: mysql_connect(): Host '64.72.112.42' is not allowed to connect to this MySQL server in /home/www/joehou.hostingrapid.com/test/index.php on line 12


      Ton hébergeur a pas dut autoriser l'accès SQL à ton site...

      Essaies ça pour voir si c'est vraiment le sql qui bugue:
      <html>
      <head>
      <title>Test de mysql</title>
      </head>
      <body>

      <?php
      mysql_connect(...); // OUBLIE PAS DE REMPLIR ICI !
      $result=mysql_query("show status");

      if($result==0)
              echo("erreur".mysqlerrno().":".mysqlerror());

      elseif(mysql_num_rows($result)==0)
              echo("requete effectuée avec succcès");
      else
      {
      ?>

      <table border="1">
      <tr><td>nom de la variable</td><td>valeur</td>

      <?php
      for ($i=0; $i<mysql_num_rows($result); $i++)
              {
              echo("<tr>");
              $row_array=mysql_fetch_row($result);

              for ($j=0; $j<mysql_num_fields($result); $j++)
                      {
                      echo("<td>".$row_array[$j]."</td>");
                      }

              echo("</tr>");
              }
      ?>
      </table>
      <?php
      }
      ?>
      </body>
      </html>

      Et si ça te fait une erreur, je ne peut rien pour toi, c'est l'hébergeur
      • Partager sur Facebook
      • Partager sur Twitter
        7 juin 2007 à 16:00:48

        Probleme resolu data host : allhyper.com
        • Partager sur Facebook
        • Partager sur Twitter
          7 juin 2007 à 16:08:48

          Oups, en effet, bien vu !
          • Partager sur Facebook
          • Partager sur Twitter

          Aider moi a propo de mysql

          × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
          × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
          • Editeur
          • Markdown