Solved

JpGraph connect to MySQL

Posted on 2008-06-25
4
1,161 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now