close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Error when trying to connect to db locally - menu.php

Thread began 8/20/2009 2:57 pm by higglebottom354154 | Last modified 9/28/2009 12:13 pm by Jimmy Wu | 3426 views | 6 replies |

higglebottom354154

Error when trying to connect to db locally - menu.php

Hi,
I keep receiving these error message when trying to view any page locally. I only see the top part of the logo and one menu item.

* Notice: Undefined variable: database_localhost in /Users/kate/Sites/Powerstore/CSSMenuWriter/cssmw_home/menu.php on line 58

Notice: Undefined variable: localhost in /Users/kate/Sites/Powerstore/CSSMenuWriter/cssmw_home/menu.php on line 58

Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /Users/kate/Sites/Powerstore/CSSMenuWriter/cssmw_home/menu.php on line 58

Notice: Undefined variable: localhost in /Users/kate/Sites/Powerstore/CSSMenuWriter/cssmw_home/menu.php on line 60

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /Users/kate/Sites/Powerstore/CSSMenuWriter/cssmw_home/menu.php on line 60

My localhost.php:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_localhost = "localhost";
$database_localhost = "powerstore";
$username_localhost = "root";
$password_localhost = "****";
$localhost = mysql_pconnect($hostname_localhost, $username_localhost, $password_localhost) or trigger_error(mysql_error(),E_USER_ERROR);
?>

Thanks in advance for any help. Kate

Sign in to reply to this post

Jason ByrnesWebAssist

Can you post the code form CSSMenuWriter/cssmw_home/menu.php at lines 58 and 60 where the error is occurring?

Sign in to reply to this post

higglebottom354154

love to. here is the code from line 58-60:
mysql_select_db($database_localhost, $localhost);
$query_menuwriter_productcategories = "SELECT CategoryName, CategoryID FROM productcategories";
$menuwriter_productcategories = mysql_query($query_menuwriter_productcategories, $localhost) or die(mysql_error());

Sign in to reply to this post

Jason ByrnesWebAssist

Is the following code at the top of any page that has a menu?:
<?php require_once('Connections/localhost.php'); ?>

Sign in to reply to this post

higglebottom354154

yes it is. it's the second line in each file. thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

I have created a tech support ticket for this. To view and edit your ticket, please log into your support history:
supporthistory.php?

Sign in to reply to this post

Jimmy Wu

This issue was caused by some Dreamweaver settings and site settings. The site needs to be defined with document relative as opposed to root relative.

Sign in to reply to this post

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...