CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 MYSQL connection in common.php

Print topic Send  topic

Author Message
bhurban

Posts: 12
Posted: 07/21/2011, 1:53 AM

I am using ccs 2.3. I have uploaded a simple database on server, but it does not show the records. It gives while bland screen when I run the page.
I put following in my COMMON.PHP page:
$this->DB = "MySQL";
$this->DBDatabase = "farahm23_db";
$this->DBHost = "mysql14.freehostia.com";
$this->DBPort = "3306";
$this->DBUser = "farahm23_db";
$this->DBPassword = "mangos";

but it does not work.
The hosting company propose following figures to put in my page:

Database Server: mysql14.freehostia.com
Database Name: farahm23_db
Database Username: farahm23_db
Password: mangos
-------------------------------------------------
Hosting company used following script on my site to test it:

<?php

$link = mysql_connect('mysql14.freehostia.com', 'farahm23_db', 'mangos');

if (!$link) {

die('Could not connect: ' . mysql_error());

}

echo 'Connected successfully';

mysql_close($link);

?>

This script is working fine. So there is no issue of database setup etc.
Actually hosting company don't support third party scripts.
Where should I make changes in my common.php page? Any suggestion please....
View profile  Send private message
Gena

Posts: 591
Posted: 07/21/2011, 2:35 AM

1. Not sure why you add this manually in common.php. When you set your Server database it should generate automatically, in

$CCConnectionSettings = array (...

2. btw try to use
$this->DBPort = "";

_________________
Gena
View profile  Send private message
bhurban

Posts: 12
Posted: 07/21/2011, 2:45 AM

Gena, I tried that but I didn't work
View profile  Send private message
Gena

Posts: 591
Posted: 07/21/2011, 2:48 AM

where in your COMMON.PHP put that code? manually?
_________________
Gena
View profile  Send private message
bhurban

Posts: 12
Posted: 07/21/2011, 2:55 AM

no, I generated the project on my localhost and then after uploading it on site, I changed it accordingly.
View profile  Send private message
Gena

Posts: 591
Posted: 07/21/2011, 3:07 AM

Quote bhurban:
no, I generated the project on my localhost and then after uploading it on site, I changed it accordingly.

sounds really strange. You don't need to change it manually!

Check docs topic "Configuring Publishing Settings", look at Publishing Files Locally / Publishing Files By FTP



_________________
Gena
View profile  Send private message
datadoit
Posted: 07/21/2011, 5:53 AM

A common misunderstanding with CCS Project Settings is the feature of
having a connection setting per publishing location. The two are
interrelated. So if you have a publishing location of 'localhost', then
you'll have an accompanying connection setting. If you have a
publishing location to an FTP host, then you'll have an accompanying
connection setting.

This does not mean that you'll create multiple connections from the
Connections tab! What you'll do is define your publishing location,
such as Local/Network. Then, you'll go define the Connection (such as
InternetDB). You'll notice at the bottom of the connection settings,
you'll see a comment such as "The changes will be applied to server
'Server1'."

Then, create another publishing location, such as your production FTP
server, and go back to the Connections, choose your connection, and now
you'll notice that the comment will be "The changes will be applied to
server 'Server2'." or whatever you called it. This will create the two
entries into your Common.php file.

NEVER EVER NEVER EVER NEVER EVER EVER NEVER alter anything in Common.php
in the gray background areas. As soon as you do, CodeCharge will not
write any new settings information to the file for the areas effected.

So follow the guidelines above. If you've altered Common.php, delete
the entire file or the contents of the entire file, then let CodeCharge
regenerate it with your project settings. Now, as you publish to your
respective locations, CodeCharge will publish the connection settings
accordingly for that particular location you chose. A very powerful and
flexible feature of CCS that I have yet to find in any comparable
product out there.
bhurban

Posts: 12
Posted: 07/21/2011, 7:22 AM

WoW, so simple and detailed answer. I appreciate your favour. I will check it by tomorrow and let you know the results.... one again thanks a lot for your favour.
View profile  Send private message
tfertil

Posts: 43
Posted: 07/21/2011, 5:32 PM

Hi, bhurban:

Just a general security advice: are you aware that you have made your database user and password public? If mysql14.freehostia.com is NOT an intranet site and if remote access is enabled, then you have exposed your database to anyone willing to connect to it.

Also there's a problem with your code: you're instructing CCS to access the database via the server name, which in turns goes to a DNS and back. This is the equivalent to access your database via a web connection from outside the server. Your PHP code has no need to do that: it runs at the same server (or at least at the same internal network).

So, almost all providers block this kind of access -"external" access-.

Have you tried using "localhost" or "127.0.0.1" instead of your server name?

Regards,
View profile  Send private message
bhurban

Posts: 12
Posted: 07/21/2011, 11:56 PM

Yes tfertil, I tried localhost, but it didn't work.
Your suggestion regarding security that I had exposed the userid and password, please note that I didn't mention orignianl password but it is fake.
Thanks a lot for your suggestions.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.