Solved

JpGraph connect to MySQL

Posted on 2008-06-25
4
1,168 Views
Last Modified: 2013-12-12
Hello
i use JpGraphs and MySQL to get data.
there is a simple question:
i have a graph.php file that build the graph.. question is if i connect to DB by the include link:::
unclude ("../../../dataBaseInfo.php");
connection doesnt work
but if i put the connection code itself connection works fine...::   WHY is that?
$db['host'] = 'host';
$db['user'] = 'vlad';
$db['password'] = "123456ff" ;
$db['database'] = db_name;
//Connect
$our_db = mysql_connect($db['host'],$db['user'],$db['password'])
      or die("Can't connect to database");
//Choose database
@mysql_select_db( $db['database'] ) or die( "Unable to select database. Please contact site administrator.");
0
Comment
Question by:nzrubin
  • 3
4 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 21872573
You will have to check the include ?
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 21872577
try to include and print the value  then check it
0
 
LVL 4

Author Comment

by:nzrubin
ID: 21879576
how to do it? include and print the value?
0
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 50 total points
ID: 21881052
i meant,

check the path what you map ..

../
or .../../
or ../../../

which is correct? or path
include ("../../../dataBaseInfo.php");

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question