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
BP_GENBANK2GFF(1p)					User Contributed Perl Documentation					BP_GENBANK2GFF(1p)

NAME
bp_genbank2gff.pl - Load a Bio::DB::GFF database from GENBANK files. SYNOPSIS
% bp_genbank2gff.pl -d genbank -f localfile.gb % bp_genbank2gff.pl -d genbank --accession AP003256 % bp_genbank2gff.pl --accession AP003256 --stdout DESCRIPTION
This script loads a Bio::DB::GFF database with the features contained in a either a local genbank file or an accession that is fetched from genbank. Various command-line options allow you to control which database to load and whether to allow an existing database to be overwritten. The database must already have been created and the current user must have appropriate INSERT and UPDATE privileges. The --create option will initialize a new database with the appropriate schema, deleting any tables that were already there. COMMAND-LINE OPTIONS Command-line options can be abbreviated to single-letter options. e.g. -d instead of --database. --create Force creation and initialization of database --dsn <dsn> Data source (default dbi:mysql:test) --user <user> Username for mysql authentication --pass <password> Password for mysql authentication --proxy <proxy> Proxy server to use for remote access --stdout direct output to STDOUT --adaptor <adaptor> adaptor to use (eg dbi::mysql, dbi::pg, dbi::oracle) --viral the genome you are loading is viral (changes tag choices) --source <source> source field for features ['genbank'] EITHER --file Arguments that follow are Genbank/EMBL file names OR --gb_folder What follows is a folder full of gb files to process OR --accession Arguments that follow are genbank accession numbers (not gi!) OR --acc_file Accession numbers (not gi!) in a file (one per line, no punc.) OR --acc_pipe Accession numbers (not gi!) from a STDIN pipe (one per line) SEE ALSO
Bio::DB::GFF, bulk_load_gff.pl, load_gff.pl AUTHOR
Scott Cain, cain@cshl.org Copyright (c) 2003 Cold Spring Harbor Laboratory This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty. perl v5.14.2 2012-03-02 BP_GENBANK2GFF(1p)
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy