开发者

php script that includes class structure doesn't work [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

I have a php script running on centos 5.x When i use a code like

$db->connect();

php script doesn't work.I use php myscript.php and it does nothing. .. .. ..

$db->connect();
echo "Hello world";

when i run above script it does nothing.Nothing means the like this; [root@xxxxxxx update_call_history]# php update_call_history.php {press enter} [root@xxxxxxx update_call_history]#

but if i change the script like this

echo "hello world";

it works.I think my php doesnt run class structured script,Is there any missin开发者_如何学JAVAg module or what. Thanks for advance...


If all the information you've been able to gather is "doesn't work" you need to do two things:

  1. Configure your environment to generate and display/log all error messages.
  2. Check the return value of the function calls, test whether it was successful and print the exact error message if not.


php-mysql module wasn't installed so it couldn't connect to database.


Make sure that:

  • mysql server is on
  • you have turned on error reporting
  • you are specifying correct credentials
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜