Sponsored Content
Special Forums UNIX and Linux Applications Virtualization and Cloud Computing Problems with PHP query to MySQL database Post 302378058 by hero132 on Sunday 6th of December 2009 08:40:43 PM
Old 12-06-2009
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 02:14 AM.. Reason: code tags, please...
 

4 More Discussions You Might Find Interesting

1. Programming

How to query one to many mysql

Hi there, I have a hierarchical database that include 4 tables. Table A is the parent of B, B is Parent of C, C is parent of D. If I want to query everything in D that is associated with A.name, how do I do that? Thanks! YanYan (0 Replies)
Discussion started by: pinkgladiator
0 Replies

2. Web Development

mysql query help

hello all i have 2 columns every column in the following format column1 2011-04-01 11:39:54 column2 2019-02-03 00:00:00 i want get difference between above data as following 2 days 11:39 how to do so ? i tried many functions but nothing works please advice what is the query... (6 Replies)
Discussion started by: mogabr
6 Replies

3. Linux

PHP is not execute the query from mysql in Linux

Hi , I have ran the php script from Linux box. It is running, But I can able to see any html content. There is no mysql data on that page. I have checked . 1) Mysql and data bases are connected successfully. Please help and guild me If I missed any think during the configuration. ... (13 Replies)
Discussion started by: Mani_apr08
13 Replies

4. Programming

Need help in mysql query

Hi All, i have a table in mysql with the following data Table name Test Assettype Serial_No Status location Mouse 123456 In Stock chennai Mouse 98765 Allocated chennai Keyboard ... (2 Replies)
Discussion started by: venkitesh
2 Replies
TXAWS-DISCOVER(1)						   User Commands						 TXAWS-DISCOVER(1)

NAME
txaws-discover - txAWS AWS API discovery tool SYNOPSIS
txaws-discover [--key KEY] [--secret SECRET] [--endpoint ENDPOINT] DESCRIPTION
Purpose: Invoke an EC2 API method with arbitrary parameters. --action ACTION [PARAMETERS, ...] OPTIONS
--key The AWS access key to use when making the API request. --secret The AWS secret key to use when making the API request. --endpoint The region endpoint to make the API request against. --action The name of the EC2 API to invoke. -h, --help Show help message. Description: The purpose of this program is to aid discovery of the EC2 API. It can run any EC2 API method, with arbitrary parameters. The response received from the backend cloud is printed to the screen, to show exactly what happened in response to the request. The --key, --secret, --end- point and --action command-line arguments are required. If AWS_ENDPOINT, AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY environment variables are defined the corresponding options can be omitted and the values defined in the environment variables will be used. Any additional parameters, beyond those defined above, will be included with the request as method parameters. EXAMPLES
The following examples omit the --key, --secret and --endpoint command-line arguments for brevity. They must be included unless corresponding values are available from the environment. Run the DescribeRegions method, without any optional parameters: txaws-discover --action DescribeRegions Run the DescribeRegions method, with an optional RegionName.0 parameter: txaws-discover --action DescribeRegions --RegionName.0 us-west-1 txaws-discover 0.2.3 May 2012 TXAWS-DISCOVER(1)
All times are GMT -4. The time now is 09:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy