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
php-config(1)							Scripting Language						     php-config(1)

NAME
php-config - get information about PHP configuration and compile options SYNOPSIS
php-config [options] DESCRIPTION
php-config is a simple shell script for obtaining information about installed PHP configuration. OPTIONS
--prefix Directory prefix where PHP is installed, e.g. /usr/local --includes List of -I options with all include files --ldflags LD Flags which PHP was compiled with --libs Extra libraries which PHP was compiled with --man-dir The directory prefix where the manpages is installed --extension-dir Directory where extensions are searched by default --include-dir Directory prefix where header files are installed by default --php-binary Full path to php CLI or CGI binary --php-sapis Show all SAPI modules available --configure-options Configure options to recreate configuration of current PHP installation --version PHP version --vernum PHP version as integer SEE ALSO
php(1) VERSION INFORMATION
This manpage describes php, version 7.1.19. COPYRIGHT
Copyright (C) 1997-2018 The PHP Group This source file is subject to version 3.01 of the PHP license, that is bundled with this package in the file LICENSE, and is available through the world-wide-web at the following url: http://www.php.net/license/3_01.txt If you did not receive a copy of the PHP license and are unable to obtain it through the world-wide-web, please send a note to license@php.net so we can mail you a copy immediately. The PHP Group 2018 php-config(1)
All times are GMT -4. The time now is 02:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy