close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Connection(s) to Existing Database

Thread began 8/19/2009 12:45 pm by robert222776 | Last modified 8/24/2009 12:09 pm by Eric Mittman | 2073 views | 3 replies |

robert222776

Connection(s) to Existing Database

I have an existing client php site with a database I built and connected to with DW db connections and server behaviors, etc., that utilize a dynamic master/detail page relationship. The database is simple, with a table for members and one for users. Consequently, I already have a Connection folder and file. In addition, as part of the above, I already have a simple CMS to handle member/user edits, additions, and deletions of database records. Again, all built DW server behaviors prior to my having any WA products. Also, obviously we are dealing with a live server and not a testing server situation.

1. Now I want to add PowerCMS to the mix. I have already added the PowerCMS tables to the existing database. My first thought is that I want to leave the existing CMS as is, and use PowerCMS to "manage" the rest of the static site pages. Is that the recommended approach, as opposed to abandoning the existing CMS in favor of using PowerCMS to manage the entire site?

2. Assuming that I leave the current CMS in place, now the question is what to do with the Connections folder at the "root" of the CMS100 folder. I would prefer to leave all the PowerCMS folders and files inside of the CMS100 folder at the site root to keep things tidy, instead of placing them separately at the site root (where the other Connection folder resides). With the CMS100 folder in place at the site root, it seems like I would need a second database connection for the benefit of the PowerCMS files. Do I really need more than one connection to the same database with this scenario?

3. I suppose another option is to create a second database for PowerCMS and make the connection to that database, but that seems somewhat redundant and unnecessary. True?

4. How do you recommend I proceed in this situation?

Thanks,
Robert

Sign in to reply to this post

Eric Mittman

There is going to be a problem with trying to have a single connection file for all of the pages in your setup. The problem is that the pages that were created with the existing connection will reference that connections name in the code for the recordsets and other db manipulation. The connection for PowerCMS is called localhost, so if your existing connection does not have the same name it will not work to have a single connection for the pages without updating your existing pages to work with the new connection file.

So you can either leave your connection file in place and have the PowerCMS connection file in its folder or you can update the require once line for your connection file and the connection name on your existing pages to use the new PowerCMS connection.

To update your existing pages you would update the require once to go into the CMS100 folder and then into Connections/localhost.php. You would also need to update the code on the page, you will need to look for the connection variable and update it to be the new $localhost value.

Sign in to reply to this post

robert222776

Thanks Eric. I made a second db connection that works fine.

From other posts on this forum and from the WA documents I was able to create a test page that I can see, and edit/update its content without the benefit of my pre-existing stylesheet for this site.

Now I would like to "attach" my pre-existing style sheet via IRite. I have tried to follow the steps (from Jason) outlined in another post dealing with "PowerCMS and IRite" without success. When I follow his suggestions and use the IRite Wizard on the content_update.php file I am getting the following error. See the before and after code:

Before:

<?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_1 = CreateRichTextEditor ("ContentValue", "../WA_iRite/", "713px", "400px", "Custom", "../custom/contents_update_ContentValue1.js", "".($totalRows_HistoryUpdate > 0)?$row_HistoryUpdate['HistoryValue']:($row_WADAContents['ContentValue']) ."");
?>

After:
<?php
// WebAssist iRite: Rich Text Editor for Dreamweaver
$WARichTextEditor_2 = CreateRichTextEditor ("myStyles", "../../WA_iRite/", "100%", "200px", "Default", "../custom/contents_update_myStyles1.js", "");
?>

This line is also inserted at the top of the page with the others:
<?php require_once("../../WA_iRite/WARichEditorPHP.php"); ?>

When I upload the file I get the following error:

Warning: main(mydomain/WA_iRite/fckeditor.php) [function.main]: failed to open stream: No such file or directory in /mydomain/WA_iRite/WARichEditorPHP.php on line 1

Fatal error: main() [function.require]: Failed opening required '/mydomain/WA_iRite/fckeditor.php' (include_path='.:/opt/php/lib/php/') in /mydomain/WA_iRite/WARichEditorPHP.php on line 1

Also, I do not see any file called "contents_update_myStyles1.js" which was named in the above "after" code.

Any suggestions?

Thanks,
Robert

Sign in to reply to this post

Eric Mittman

When I look at the update page for the contents I can see that the iRite editor include code looks like this:

<?php require_once("../WA_iRite/WARichEditorPHP.php"); ?>

The error message you are getting indicates that there is a problem with the include path you have on this page. Please adjust this path accordingly so that the correct include file is referenced when the page loads. This should resolve the error.

The js file referenced is contained inside of the iRite folder in your site. You may also want to upload the iRite folder for the site again if it is not found on the server.

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