close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot Connect MySQL Database

Thread began 7/07/2009 12:16 pm by susan346031 | Last modified 7/07/2009 3:51 pm by susan346031 | 6403 views | 24 replies |

susan346031

Cannot Connect MySQL Database

Hi,

I am unable to connect to the database and test Powerstore. I have been able to make a successful localhost connection in Dreamweaver and using the store.sql information (imported to my database & table) but no luck.


Notice: Undefined variable: database_test in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Notice: Undefined variable: localhost in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Notice: Undefined variable: localhost in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 67

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 67

In the menu.php, lines 65 & 67, here is the code:
65 mysql_select_db($database_locahost, $localhost);

67 $menuwriter_productcategories = mysql_query($query_menuwriter_productcategories, $localhost) or die(mysql_error());


Since it references $localhost, I also checked localhost.php--
$hostname_localhost = "localhost";
$database_localhost = "test";
$username_localhost = "durable";
$password_localhost = "****";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);


Any help would be appreciated! :)
Thanks

SH

Sign in to reply to this post

Ray BorduinWebAssist

According to the error you have $database_test on line 65 and not $database_localhost so maybe you didnt' upload the page but it seems like the code you are showing does not correspond to the code generating the error.

Sign in to reply to this post

susan346031

Hi Ray,
You are correct, I tried to specify the specific table, but even with database_localhost, the error is the same. I refreshed, here is the current error.


Notice: Undefined variable: database_locahost in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Notice: Undefined variable: localhost in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 65

Notice: Undefined variable: localhost in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 67

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\htdocs\DurableToys\CSSMenuWriter\cssmw_home\menu.php on line 67

Thank you

Sign in to reply to this post

Ray BorduinWebAssist

That means that the page you are viewing doesn't have a require_once() for the connection. That is why the variable is not defined. Add the connection include on top of the page where the menu is located and it should correct the problem.

Sign in to reply to this post

susan346031

There is an includes command in the menu.php page. Do I need to modify it?


<?php require_once('../../Connections/localhost.php'); ?><?php } // End MenuWriter ignore connection includes ?>

Thanks

Sign in to reply to this post

susan346031

When I went to the Live Data view in Dreamweaver on menu.php, I also got an error regarding the WA_Globals
(An error occurred while requesting the document from the testing server:)


Notice: Undefined variable: WAGLOBAL_localRoot in C:\htdocs\DurableToys\CSSMenuwriter\cssmw_home\menu_3fgoomf88b.php on line 2
Notice: Undefined variable: WAGLOBAL_remotelRoot in C:\htdocs\DurableToys\CSSMenuwriter\cssmw_home\menu_3fgoomf88b.php on line 3
Warning: strpos() [function.strpos]: Empty delimiter in C:\htdocs\DurableToys\CSSMenuwriter\cssmw_home\menu_3fgoomf88b.php on line 6
Warning: strpos() [function.strpos]: Empty delimiter in C:\htdocs\DurableToys\CSSMenuwriter\cssmw_home\menu_3fgoomf88b.php on line 10

Here are the lines (2 & 3 of the menu.php in reference to WA_Globals
$WA_localRoot = "".$WAGLOBAL_localRoot."";
$WA_remoteRoot = "".$WAGLOBAL_remoteRoot."";

and 6 & 10
if ((strpos($WA_curURL,strtolower($WA_localRoot)) !== false && strpos($WA_curURL,strtolower($WA_localRoot)) == 0) && (strlen($WA_localRoot) >= strlen($WA_remoteRoot) || strpos($WA_curURL,strtolower($WA_localRoot)) === 0)) {
$assumedRoot = $WA_localRoot;

if (strpos(strtolower($WA_thisFile), strtolower($assumedRoot)) === 0) {
$WA_thisFile = substr($WA_thisFile, strlen($assumedRoot));


Here is the info in WA_Globals:
$WAGLOBAL_localRoot = "/DurableToys/";
$WAGLOBAL_remoteRoot = "/DurableToys/";

Local Root is C:\htdocs\DurableToys\
Remote Root is DurableToys/

??

Sign in to reply to this post

susan346031

Here are the includes (including WA_Globals) for the index.php page
I believe this is what you're referring to....

<?php require_once( "WA_Globals/WA_Globals.php" ); ?>
<?php require_once('Connections/localhost.php'); ?>

Sign in to reply to this post

Ray BorduinWebAssist

Is that the page you are browsing when you see these errors? Are those on top of the page? That doesn't make sense... are you sure you are viewing that page. If so it should not say those variables are not defined because they are defined in that include.

Sign in to reply to this post

susan346031

Yes, I am refreshing the index.php page, with those includes that return those errors.

Sign in to reply to this post

Ray BorduinWebAssist

Do you have a url where I can view it? Maybe the locations of those files has changed? If they are included, and the variables are defined in them, then you should not get an error that those variables are not defined.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...