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

 help with CodeCharge PHP deploy

Print topic Send  topic

Author Message
mike
Posted: 10/15/2005, 2:28 PM

I'm try to deploy a PHP project to my ISP's server

Username password is OK - I can connect via PHPAdmin
I have set the correct password

Warning: mysql_connect(): Access denied for user: 'macweb@localhost' (Using
password: NO) in /home/macweb/public_html/macindex/db_mysql.php on line 101
Database error: pconnect(, , $DBPassword) failed.
MySQL Error: 0 ()
Session halted.
--------

I have checked and re-checked the setting as the FAQ's RE: MySQL connection
I've tested a simple PHP scripts below and this works fine

This leads me thing I've not setup the Server info correctly
but I've looked at the Faq's and checked

Tried:
localhost, blank, servername.isp.com
port as blank and 3306

All results in the same error
(also tried entering info manually in db_mysql.php)

Deleted and re-setup the connection settings too.

What have I missed??

-------- These scripts below work fine - with my username and password

//---dbinfo_inc.php -- defines connection info
<?
$username="myusername";
$password="myPassword";
$database="macweb";
?>
//--End

//---setup.php --- Creates Tables in database
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first
varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT
NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30)
NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2
(id))";
mysql_query($query);
mysql_close();
echo "Database created";
?>
//---End

//---insert.php
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

$query = "INSERT INTO contacts VALUES
('','$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query);

mysql_close();
?>
//---End

//---add.html
<form action="insert.php" method="post">
First Name: <input type="text" name="first"><br>
Last Name: <input type="text" name="last"><br>
Phone: <input type="text" name="phone"><br>
Mobile: <input type="text" name="mobile"><br>
Fax: <input type="text" name="fax"><br>
E-mail: <input type="text" name="email"><br>
Web: <input type="text" name="web"><br>
<input type="Submit">
</form>
//---End

//---index.php
<?
include("dbinfo.inc.php");
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);

$num=mysql_numrows($result);

mysql_close();

echo "<b><center>Database Output</center></b><br><br>";

?>
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<th><font face="Arial, Helvetica, sans-serif">Name</font></th>
<th><font face="Arial, Helvetica, sans-serif">Phone</font></th>
<th><font face="Arial, Helvetica, sans-serif">Mobile</font></th>
<th><font face="Arial, Helvetica, sans-serif">Fax</font></th>
<th><font face="Arial, Helvetica, sans-serif">E-mail</font></th>
<th><font face="Arial, Helvetica, sans-serif">Website</font></th>
</tr>

<?
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");
$mobile=mysql_result($result,$i,"mobile");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$web=mysql_result($result,$i,"web");
?>

<tr>
<td><font face="Arial, Helvetica, sans-serif"><? echo "$first $last";
?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo "$phone";
?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo "$mobile";
?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><? echo "$fax"; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif"><a href="mailto:<? echo
"$email"; ?>">E-mail</a></font></td>
<td><font face="Arial, Helvetica, sans-serif"><a href="<? echo "$web";
?>">Website</a></font></td>
</tr>
<?
++$i;
}
echo "</table>";

?>
//---End


peterr


Posts: 5971
Posted: 10/15/2005, 2:49 PM

What database types did you select in both Design and Server tabs of your connection?

Also, are you using more than 1 database connection in your project?
Finally, try deleting Common.php from your project in case it is corrupted. It will be rebuilt next time when you publish.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mike
Posted: 10/15/2005, 4:09 PM

Thanks - but found the problem.

After I posted my message I went back to make some other changes
and found the original 'Internet' connection - I changed this name
when I deleted and recreated the connection but hadn't been
changed on the pages

I had to go to each page and each item like drop list and change it
manually!

Now works



"peterr" <peterr@forum.codecharge> wrote in message
news:5435179861fc5d@news.codecharge.com...
> What databases type did you select in both Design and Server tabs of your
> connection?
>
> Also, are you using more than 1 database connection in your project?
> Finally, try deleting Common.php from your project in case it is
corrupted. It
> will be rebuilt next time when you publish.
> _________________
> Peter R.
> YesSoftware Forums Moderator
> For product support please visit http://support.yessoftware.com
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.