php script that includes class structure doesn't work [closed]
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:
- Configure your environment to generate and display/log all error messages.
- 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
精彩评论