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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes!!!! It works now!!!
Thanks, Thanks and Thanks!!!!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
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
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.
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>
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).
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!
Yes!!!! It works now!!!
Thanks, Thanks and Thanks!!!!!!
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
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
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.