![]() |
mysql query sometime return nothing in widgets
hi all,
i have added a new widget in my vbulletin cms. It's a "direct execution widget" in it i have an Mysql query that return counts of some rows in my database.. but sometimes it returns nothing :S i have tryed to run the query manually from "phpmyadmin" and the query itself works this is the code of my widget: Code:
require_once("mysql_vars.php"); maybe cache problem ? :S i have the same problem with similar widgets that should return data from an database.. thanks, i'm using vbulletin 4.1.10 |
You could try checking the return values of your mysql calls and in the case of an error, call mysql_error() to get the details. For instance, the example code on this page: http://us2.php.net/manual/en/function.mysql-connect.php shows how it could be done for mysql_connect (although you probably don't want to call die() in your widget).
|
changed in:
Code:
code removed edit, ok now it give me the error: Quote:
edit2: if i try to put directly mysql account informations in mysql_connect($host, $user, $pass); with "mysql_connect(127.0.0.1, "XXX", "XXX");" sometimes it works, and sometimes the widget closes on himself like this screen: http://img62.imageshack.us/img62/4190/immaginepmx.png http://img828.imageshack.us/img828/2008/immagine2zw.png |
up
please, the problem isn't solved |
I don't see anything wrong (although I could be missing something of course), but if it's blank sometimes that seems to mean that something is causing an error, but only sometimes. I don't know why the query would sometimes return nothing.
Maybe try putting in a line like: Code:
$output .= "1"; return; start with it right under the reuqire once. If it always works (just shows "1"), then move it down a line and try again. When (if) you get to a point where the problem starts happening, you'll know it's caused by the line above. |
hum i have solved using file() to grab data from an external php file instead of queryng the server
in this way all works perfect :P thanks |
All times are GMT. The time now is 06:06 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|