Skip to main content
Participating Frequently
April 22, 2007
Question

DW and Database conections

  • April 22, 2007
  • 6 replies
  • 622 views
Hello
I´m using DW8 and easyphp on my pc, and my page works just fine, with dynamic elements
The code for the connection is:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_connDB = "localhost";
$database_connDB = "dados";
$username_connDB = "admin";
$password_connDB = "***********";
$connDB = mysql_pconnect($hostname_connDB, $username_connDB, $password_connDB) or trigger_error(mysql_error(),E_USER_ERROR);
?>

In server for the webpage, the CPanel give´s me this code to connect to Database:
$dbh=mysql_connect ("localhost", "nunomath_admin", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("nunomath_dados");

My question is, what should i do to make this work???

Best regards
Mathiotte
This topic has been closed for replies.

6 replies

BorgasAuthor
Participating Frequently
April 23, 2007
Hello

thanks for your help, finally working!
since the connection is diferent in servers, is´t possible to keep both connections, to work one on pc and the other in the webserver?? To keep constructing the site, and keep the virtual server on my pc

Best Regards
Nuno
Inspiring
April 23, 2007
Gary White wrote:
> Change virtual() to include()

Also use a relative path to the file. The include() command doesn't
understand site-root-relative links.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
BorgasAuthor
Participating Frequently
April 23, 2007
quote:

Originally posted by: Newsgroup User
Gary White wrote:
> Change virtual() to include()

Also use a relative path to the file. The include() command doesn't
understand site-root-relative links.

--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/



Hello
Can you please explain this better, to me??
Are you saying, in the form, select the folder on action and make a change on the pop-up window???

Thanks for your help
Nuno
Inspiring
April 23, 2007
On Sun, 22 Apr 2007 21:30:57 +0000 (UTC), "Borgas"
<webforumsuser@macromedia.com> wrote:

> " Fatal error: Call to undefined function virtual() in
>/home/nunomath/public_html/teste.php on line 1 "


Change virtual() to include()

Gary
BorgasAuthor
Participating Frequently
April 22, 2007
Hello again
thanks for the quick reply
I already put in pc in phpmyadmin, the same exactly like i create on webserver.
Upload the file and onload of page, give me this:

" Fatal error: Call to undefined function virtual() in /home/nunomath/public_html/teste.php on line 1 "

Sorry for my english
Thanks
Nuno
BorgasAuthor
Participating Frequently
April 22, 2007
Hello again
thanks for the quick reply
I already put in pc in phpmyadmin, the same exactly like i create on webserver.
Upload the file and onload of page, give me this:

" Fatal error: Call to undefined function virtual() in /home/nunomath/public_html/teste.php on line 1 "

Sorry for my english
Thanks
Nuno
Inspiring
April 22, 2007
On Sun, 22 Apr 2007 17:36:26 +0000 (UTC), "Borgas"
<webforumsuser@macromedia.com> wrote:

> $database_connDB = "dados";
> $username_connDB = "admin";

Change the above to:

$database_connDB = "nunomath_dados";
$username_connDB = "nunomath_admin";


Gary