CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Connection PHP Mysql

Print topic Send  topic

Author Message
Rob King
Posted: 10/18/2003, 3:43 PM

Hi there,

I hope that someone can help me here.

I am using codecharge and have just transfered a site to php using mysql
from asp and access. so i am very new to mysql and php.

Firstly i have a port/firewall server, so i am stuck on connecting to my isp
from codecharge, (i am not really botherd about this as i like to work
loacaly and only upload when i am happy all the little bugs have gone.)

So i have installed on my xp computer php and mysql and is working fine.
using the mysql odbc drivers

ok now what i want to do is upload the site to my isp.but i know that i have
to change my connection settings. so they will connect to the web mysql.

my isp has given my the following i should use for connecting

$dbh=mysql_connect ("localhost", "firth_", "<PASSWORD HERE>") or die ('I
cannot connect to the database because: ' . mysql_error());
mysql_select_db ("firth_Firthcliffe");

Well i thought i could put this in the connection string.

Database error: cannot use database firthcliffe
MySQL Error: 1044 (Access denied for user: '@localhost' to database
'firthcliffe')
Session halted.

I have searched the gotocode website,but i havent found anything to get this
connection. and am running out of ideas.

Hope this makes sence and someone out there has a solution.

Thanks

Rob King

Walter Kempees
Posted: 10/19/2003, 5:50 PM

Hi Rob,

First, I am a Pro but not especially at CCS.

Second, my solution to your problem might not be the solution you need.

Thirdly DonB probably got the right answer.......

But, It'll probably do for the meanwhile, assuming that you are using CCS
(You state CC but use the CCS discussion).

After ftp'ing your site over to your isp, on your source machine copy the
file common.php to something like org_common.php.

Open the file common.php and search for function Initialize()

(Next is an example from my own backyard, changed to fit your garden:

function Initialize()
{
$this->AbsolutePage = 0;
$this->PageSize = 0;
$this->DB = "MySQL";
$this->DBDatabase = "firth_Firthcliffe"; <== changed line
$this->DBHost = "localhost"; <++
$this->DBPort = "3306";
$this->DBUser = "firth_"; <++
$this->DBPassword = "<PASSWORD HERE>"; <++
$this->Persistent = false;
$this->RecordsCount = 0;
$this->RecordNumber = 0;
$this->DateFormat = Array("dd", "/", "mm", "/", "yyyy", " ", "HH", ":",
"nn", ":", "ss");
$this->BooleanFormat = Array("true", "false", "");
$this->Uppercase = false;
$this->Errors = New clsErrors();
}

The changes made are obviously the ISP names replacing the ones u use
locally.

If this works for you, and you don't really need to change anything else on
a regular bases you could change the file's access right to read only, and
just remember to overwrite it after any major change in common.php.

File compare could help you out there.

Hope it works for you, and agree that CCS should have a simple way of
catering for AT LEAST 2 different connects MORE would (in this case) be
better, reminding that one develops 1 application and distribute it many
times (prefferably)

Happy Generating.

Walter







"Rob King" <rob.king@the-king-family.org.uk> schreef in bericht
news:bmsfmh$unc$1@news.codecharge.com...
> Hi there,
>
> I hope that someone can help me here.
>
> I am using codecharge and have just transfered a site to php using mysql
> from asp and access. so i am very new to mysql and php.
>
> Firstly i have a port/firewall server, so i am stuck on connecting to my
isp
> from codecharge, (i am not really botherd about this as i like to work
> loacaly and only upload when i am happy all the little bugs have gone.)
>
> So i have installed on my xp computer php and mysql and is working fine.
> using the mysql odbc drivers
>
> ok now what i want to do is upload the site to my isp.but i know that i
have
> to change my connection settings. so they will connect to the web mysql.
>
> my isp has given my the following i should use for connecting
>
> $dbh=mysql_connect ("localhost", "firth_", "<PASSWORD HERE>") or die ('I
> cannot connect to the database because: ' . mysql_error());
> mysql_select_db ("firth_Firthcliffe");
>
> Well i thought i could put this in the connection string.
>
> Database error: cannot use database firthcliffe
> MySQL Error: 1044 (Access denied for user: '@localhost' to database
> 'firthcliffe')
> Session halted.
>
> I have searched the gotocode website,but i havent found anything to get
this
> connection. and am running out of ideas.
>
> Hope this makes sence and someone out there has a solution.
>
> Thanks
>
> Rob King
>
>

Chris
Posted: 10/20/2003, 6:32 AM

The answer is to not use the string, and take the various bits out of it,
and place them in the Properties > Database page in CodeCharge.

Database Name Host
firth_Firthcliffe localhost

Login Password
firth_ xxxxxxx

Database Type
MySQL

Then when you publish (upload your site) and all should work.


ie database
"Rob King" <rob.king@the-king-family.org.uk> wrote in message
news:bmsfmh$unc$1@news.codecharge.com...
> Hi there,
>
> I hope that someone can help me here.
>
> I am using codecharge and have just transfered a site to php using mysql
> from asp and access. so i am very new to mysql and php.
>
> Firstly i have a port/firewall server, so i am stuck on connecting to my
isp
> from codecharge, (i am not really botherd about this as i like to work
> loacaly and only upload when i am happy all the little bugs have gone.)
>
> So i have installed on my xp computer php and mysql and is working fine.
> using the mysql odbc drivers
>
> ok now what i want to do is upload the site to my isp.but i know that i
have
> to change my connection settings. so they will connect to the web mysql.
>
> my isp has given my the following i should use for connecting
>
> $dbh=mysql_connect ("localhost", "firth_", "<PASSWORD HERE>") or die ('I
> cannot connect to the database because: ' . mysql_error());
> mysql_select_db ("firth_Firthcliffe");
>
> Well i thought i could put this in the connection string.
>
> Database error: cannot use database firthcliffe
> MySQL Error: 1044 (Access denied for user: '@localhost' to database
> 'firthcliffe')
> Session halted.
>
> I have searched the gotocode website,but i havent found anything to get
this
> connection. and am running out of ideas.
>
> Hope this makes sence and someone out there has a solution.
>
> Thanks
>
> Rob King
>
>


   


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

Web Database

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.