Welcome Guest, please login or register.
Username:
Password:

News: Welcome to Hostpapa Forums!
Pages: [1]   Go Down
Topic Tools  
Read
October 12, 2008, 04:35:35 AM
solentairlines
Newbie
*
Posts: 2



Hi Gents,

Not a newbie on web design but then again not a full blown wizard.

I have created some code to pull data from an XML source into a mysql database.

I then have used dreamweaver to create the actual pages to display the data in PHP.

When I preview in DW the page and info is fine. I notice the page link includes.....  /public_html/xxxxxx.php.

However I have other PHP scripts in the same folder /public_html/..   however when I run these I don't have to add the /public_html/.

So my first query is why on some scripts do I need the public_html adding and on other I dont?, 

And my last query is where should my connections sit on HostPapa, inside the PUBLIC HTML folder or somewhere else.

This is the error I get at the moment.

Warning: require_once(/config-routes.php) [function.require-once]: failed to open stream: No such file or directory in /home/zecgmlhp/public_html/Connections/SQL.php on line 3

Fatal error: require_once() [function.require]: Failed opening required '/config-routes.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zecgmlhp/public_html/Connections/SQL.php on line 3

The code on SQL.PHP is as follows:

<?php
//    There is no need to edit this file. You only have to edit the config-routes.php file.
require_once('../config-routes.php');
$hostname_SQL = $server;
$database_SQL = $database;
$username_SQL = $db_user;
$password_SQL = $db_pass;
$SQL = mysql_pconnect($hostname_SQL, $username_SQL, $password_SQL) or trigger_error(mysql_error(),E_USER_ERROR);
?>

The config-routes.php code is

<?php

// Server to connect to, the default is 'LocalHost' but if it does not work use your IP address for your server
$server = "LocalHost";

// The name of the database, when using cPanel you would normally have your user name first like so: username_DATABASE-NAME
$database = " xxxxxxx_xxxxx";

// MySQL username to access the database with.   
$db_user = "xxxxxxxx";

// MySQL password to access the database with.
$db_pass = "xxxxxxxx";

//   DO NOT CHANGE THIS> THERE ARE OTHER VARIABLES THAT HAVE THIS AND ARE DEPENDENT. IF YOU RENAME IT, IT MAY NOT WORK
$table = "routes";

$con = mysql_connect("$server","$db_user","$db_pass");
?>

Thanks in anticipation.

Andy

Logged
 

Read
October 23, 2008, 04:59:18 PM
Nelson
Guest

Hello,

Typically what you have looks good and should be working.  I am afraid you might have the database user name or something like that wrong.

Please check your connection settings against our settings requirements:

http://hostpapasupport.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=75

Also if this is still not working please open a ticket with us by emailing support@hostpapasupport.com and we'll make sure to help you get this up and running.  You can also call or come online and chat.

Kind regards,
Nelson
Hostpapa Technical Support
Logged
 

Pages: [1]   Go Up
Jump to:  

Theme by webtechnica.net