Menu

No aparecen algunos menus

Help
2000-07-14
2000-07-27
  • Maximino Ameneiro

    Slo aparece un menu de los de la izquierda. En el resto sale este error:
    Warning: 0 is not a MySQL result index in themes/Default/header.php3 on line 37, 72 y 87 respectivamente.
    Utilizo para crear las tablas el phpMyAdmin

     
    • Richard Sheppard

      I'm sorry to reply in English, and I think I understand enough to try to help. When I've seen this error before, it was due to the hostname in the mysql_pconnect function.

      If you look at the lines above the three lines you mentioned (37, 72 and 87), the mysql_pconnect function uses the variables $dbhost, $dbname, and $dbpassword. These variables come from the config.php3 file, which was included in the line above.

      You might need to verify that $dbhost is either "" (null) or "localhost" in the config.php3 file.

       
      • Maximino Ameneiro

        I have tried to change the $$dbhost to "" or "localhost" but If I do it, the connection to the database does't function.

        Excuse me for the first query in spanish

         
        • Richard Sheppard

          No need to apologise for asking questions in Spanish! I use BabelFish to translate!

          Looks like the $dbhost isn't the problem then. Do you pages work alright without logging in?

          You said that you created the tables with phpMyAdmin? The three lines you mention that get the error all have queries before or after. I would be worth putting those queries into the interactive mySQL client or phpMyAdmin (if it supports it) to see if you get similar errors.

           
          • Maximino Ameneiro

            I put this query in phpMyAdmin: select title, content from mainblock;
            and this is the response (no error):

            <li><a href=index.php3>Home</a>rn<li><a href=topics.php3>Topics</a>rn<li><a href=sections.php3>Sections</a>rn<li><a href=user.php3>Your Account</a>rn<li><a href=submit.php3>Submit News</a>rn<li><a href=stats.php3>Stats</a>rn<li><a href=top.php3>Top 10</a>rn<li><a href=faq.php3>FAQ</a>

             
          • Anonymous

            Anonymous - 2000-07-21

            I have the same problem. And I'm sure that:
            - my database is on the same machine
            - the table nuke.lblocks has contents
            - query run by hand with mysql works ok.

            Any other suggestions besides changing the dbhost from localhost to 127.0.0.1 (which didn't change anything for me).

             
            • Anonymous

              Anonymous - 2000-07-21

              Reply to myself, but I know why now...

              Simply, the database context is not know to the MySQL backend at this moment and therefore SQL statements should contain database name also, not just the table name.

              I changed line 37 to:

              $MainBlock = mysql_query("select title,content from nuke.mainblock");

              and it works now!

               
              • Maximino Ameneiro

                Yes!!!! It works now!!!
                Thanks, Thanks and Thanks!!!!!!

                 
                • Anonymous

                  Anonymous - 2000-07-27

                  Even better way is to use:

                  $LeftBlocks = mysql_query("select title, content from $dbname.lblocks");

                  etc. - using $dbname ensures that when you change the name in config.php3 everything would stil work.

                  Andy

                   
      • Anonymous

        Anonymous - 2000-07-14

        I have also noticed that under some (admitedly flakey) set-ups having the dbhost as "localhost" may not work while "127.0.0.1" may. User privileges may also be the reason.

        Still, I think the problem here is the same I thought I had until I realised it was a known behaviour of the system. This happens only (to me) in the login screen. It marks an error. I think the thing should be conditioned in the same way the admin box appears only when you're admin the login screen should appear only if you're not logged in.

        Eduo

         
        • Maximino Ameneiro

          Thanks for your suggestion Eduo. The problem is that the server database is a remote computer. I need to use as dbhost the name of my server instead of localhost or 127.0.0.1.

          Otherwise, this error happens in all the pages.

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.