Solved

JpGraph connect to MySQL

Posted on 2008-06-25
4
1,174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses how to implement server side field validation and display customized error messages to the client.
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

691 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