|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| Virtualization and Cloud Computing Xen, VMWare, hypervisors, Amazon Elastic Computing Cloud, EC2, virtual storage, Amazon S3 and other cloud computing topics. |
![]() |
|
|
Search this Thread |
|
#1
|
|||
|
|||
|
Problems with PHP query to MySQL database
Hello all, I completed a website (it was code by php) and putted it to AWS, I install fedora instance in EC2 with the base is php and mysql. I putted all files of my website to folder /home/webuser/helloworld/htddocs and my database (mysql) to folder /var/lib/mysql/test ("test" is my database's name). I connect to database by a php file that is successful and its code is: Code:
<?php # mysql_connect.php
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', 'ab2345');
DEFINE ('DB_HOST', 'root@localhost');
DEFINE ('DB_NAME', 'test');
# Connect to MYSQL
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MYSQL:' .mysql_error());
mysql_select_db (DB_NAME) OR die ('Could not select the database:' .mysql_error());
?>I made query commands to my database in PuTTY succesful and had data at output But when I make query commands to database in php files (code by php) then didn't output, it is nothing. I don't know why, I searched more it in Internet but I didn't still find, I hope you can help me. Thanks, Last edited by pludi; 12-07-2009 at 01:14 AM.. Reason: code tags, please... |
| Sponsored Links | ||
|
|
|
#2
|
||||
|
||||
|
What does the php.errors log file say about this?
|
|
#3
|
|||
|
|||
|
Try change: Code:
DEFINE('DB_HOST', 'root@localhost');to Code:
DEFINE('DB_HOST', 'localhost');Got this error when trying your code: Quote:
|
| Sponsored Links | ||
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| NetHawk Cuts its Database Costs by 50% with Sun’s Embedded MySQL database | Linux Bot | MySQL DevZone RSS | 0 | 09-16-2009 10:15 PM |
| Developing MySQL Database Applications With PHP Part 1: Using the MySQL Improved Exte | Linux Bot | Solaris BigAdmin RSS | 0 | 06-12-2009 06:00 PM |
| MySQL Developer, meet “Quan” (aka the MySQL Query Analyzer) | Linux Bot | MySQL DevZone RSS | 0 | 05-15-2009 01:30 PM |
| New MySQL Enterprise with Query Analyzer Boosts Database Application Performance | Linux Bot | MySQL DevZone RSS | 0 | 11-19-2008 03:10 AM |
| How to query one to many mysql | pinkgladiator | Programming | 0 | 10-30-2008 12:45 PM |