Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

DW and Database conections

New Here ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

587
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 22, 2007 Apr 22, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

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/

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

Borgas wrote:
> 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???

No. The PHP include() command needs a path that's relative to the
document, not the site root.

include('/Connections/myfile.php'); // won't work

include('Connections/myfile.php'); // does work
include('../Connections/myfile.php'); // does work

In other words, the path to the file that you want to include must *not*
begin with a forward slash.

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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2007 Apr 23, 2007

Copy link to clipboard

Copied

LATEST
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

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines