?
Solved

Can't get script to connect to database connect script in root.

Posted on 2013-01-04
6
Medium Priority
?
314 Views
Last Modified: 2013-01-05
Can't get script to connect to database connect script in root. It's 2 levels up. Getting HTTP 500 response
register.php
0
Comment
Question by:QUESTOMNI
[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
6 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38743998
shouldn't the path be: ('../mysqli_connect.php') instead of ('.../mysqli_connect.php')

Cd&
0
 
LVL 11

Accepted Solution

by:
Chris Sandrini earned 2000 total points
ID: 38745069
two levels up is ../../

so

require ('../../mysqli_connect.php');

Open in new window

0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38745456
If it's in the 'root', you should be able to use...

require ('/mysqli_connect.php');

Open in new window

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38745924
Hmmm, that about covers the possibilities; other than hard coding an absolute path.

Cd&
0
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 38746618
After you get connected to the data base, you might want to learn about this:
http://php.net/manual/en/mysqli.real-escape-string.php
0
 

Author Closing Comment

by:QUESTOMNI
ID: 38746771
Thanks.
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

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…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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