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

PHP MySQL data display problem

New Here ,
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

I am having trouble getting data to display on my web page.

In Dreamweaver CS3, I created a new page.

Selected PHP as the type.

Saved it.

Connected a database and created a recordset (all using Dreamweavers menus. I did not write any code).

NOTE: The database is on a remote server.

The TEST button displayed the records from the recordset with no problem.

On the new page, I then typed some text.

Then dragged some fields from the Bindings tab to the page.

I saved it and then went to preview it in my browser.

The page comes up completely blank. Not even the text shows.

I then saved the page as an HTML page.

When I preview this in my browser, the text shows, but the fields and data do not.

I then tried creating a dynamic table (again, using the Dreamweaver menus.).

A similar thing happens, ie. If I save it as an HTML, the text shows and the column labels and border shows, but no data.

Nothing shows if I save it as a PHP file.

I can view the data online using files created by PHPMagic, so I know the data is there and retrievable.

It is just in pages created in Dreamweaver that don’t work.

What am I doing wrong?

TOPICS
Server side applications

Views

2.2K
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 ,
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

thats almost similar to mine.... my template for HTML  is giving me problems also ...

I build it then it works fine ... then weeks later the darn thing wont allow me to build a single page fron that template???

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
Advisor ,
Jun 04, 2009 Jun 04, 2009

Copy link to clipboard

Copied

To view php pages - or pages with PHP code in them - in a browser, the page must be served up by a Web server that supports PHP. You can set up a testing server on your local machine for this purpose. Look for WAMP (Windows), MAMP (Mac), or XXAMP for some easily installed packages.


--
Mark A. Boyd
Keep-On-Learnin' 🙂
This message was processed and edited by Jive.
It shall not be considered an accurate representation of my words.
It might not even have been intended as a reply to your message.

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 ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

My web server supports PHP. I can disply PHP pages created by other software packages, just not the Dreamweaver ones.

Frank

Date: Thu, 4 Jun 2009 19:04:03 -0600

From: forums@adobe.com

To: fchbmh@hotmail.com

Subject: PHP MySQL data display problem

To view php pages - or pages with PHP code in them - in a browser, the page must be served up by a Web server that supports PHP. You can set up a testing server on your local machine for this purpose. Look for WAMP (Windows), MAMP (Mac), or XXAMP for some easily installed packages.

--

Mark A. Boyd

Keep-On-Learnin'

This message was processed and edited by Jive.

It shall not be considered an accurate representation of my words.

It might not even have been intended as a reply to your message.

>

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 ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

pabirds wrote:

The page comes up completely blank. Not even the text shows.

That means there's an error in your PHP code, and display_errors is turned off. Edit php.ini to change display_errors. It should be this:

display_errors = On

Save php.ini, and restart Apache.

As a temporary measure, you can add this to the very beginning of your PHP page:

<?php ini_set('display_errors', '1'); ?>

As long as it's not a syntax error, such as a missing semicolon or quote, the error message should appear onscreen.

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 ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

If there is an error in the code it was done by Dreamweaver, as I did not write any code myself. I relied totally on the Dreamweaver menus.

I assumed Dreamweaver would put in all of the appropriate code for this simple page.

Therefore I also assumed someone else would have done a similar series of steps and encountered this same problem and would be able to help me.

The last thing I want to do is learn another programming language. That is one reason I selected Dreamweaver in the first place.

In my original post, I outlined the steps I took to create these pages that don't work. Did I miss some step along the way?

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 ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

pabirds wrote:

If there is an error in the code it was done by Dreamweaver, as I did not write any code myself. I relied totally on the Dreamweaver menus.

I assumed Dreamweaver would put in all of the appropriate code for this simple page.

Dreamweaver didn't make an error. It used the information you gave it. Unfortunately, relying totally on Dreamweaver to do things for you is a dangerous strategy. As Mark has pointed out, the problem lies with the use of virtual(). This is supported only by the Apache web server when PHP is loaded as a module.

Change your site definition to use links relative to the document, rather than the site root, and re-create the MySQL connection. Then the problem will go away.

Dreamweaver speeds up the generation of PHP code, but you still need to understand what it does, and whether it's suitable for the job you want it to do.

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
Advisor ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

I can't use the Report Abuse link on this thread. I just keep getting a non-descriptive error.

Can we get this Papayas1 account disabled until he turns off his auto-reply? I am now convinced that it is not the repeating email bug that affects some of us.

If moderators don't have that level of access, I can report it in the appropriate forum comments thread.

Or maybe you can turn off his email notification subscriptions?

--
Mark A. Boyd
Keep-On-Learnin' 🙂
This message was processed and edited by Jive.
It shall not be considered an accurate representation of my words.
It might not even have been intended as a reply to your message.

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 ,
Jun 06, 2009 Jun 06, 2009

Copy link to clipboard

Copied

Mark A. Boyd wrote:

I can't use the Report Abuse link on this thread. I just keep getting a non-descriptive error.

Can we get this Papayas1 account disabled until he turns off his auto-reply? I am now convinced that it is not the repeating email bug that affects some of us.

It's a bug with the forum email system. Apparently, some emails don't send the right acknowledgement to the sender's email queue. So, the message is automatically resent at intervals, usually over five days. The only solution is to lock the thread.

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 ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

I put in the error code handling that you recommended and got the following message:

Fatal error: Call to undefined function: virtual() in D:\Domains\pabirds.org\wwwroot\PHPTestSite\Untitled-5.php on line 2

Line 2 is :

<?php virtual('/Connections/test1.php'); ?>

Test1.php is the connection I created in Dreamweaver to my MySQL database.

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
Advisor ,
Jun 05, 2009 Jun 05, 2009

Copy link to clipboard

Copied

I have seen that symptom before. The solution is to use require_once() instead of virtual(). Which one DW uses is apparently related to how you have set it up for links (site-root relative vs document relative). Try using doc-relative if you are not already doing that.

See one of David Powers' messages where I learned of this.
http://forums.adobe.com/message/940000#940000

--
Mark A. Boyd
Keep-On-Learnin' 🙂
This message was processed and edited by Jive.
It shall not be considered an accurate representation of my words.
It might not even have been intended as a reply to your message.

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 ,
Jun 06, 2009 Jun 06, 2009

Copy link to clipboard

Copied

pabirds wrote:

I put in the error code handling that you recommended and got the following message:

Fatal error: Call to undefined function: virtual() in D:\Domains\pabirds.org\wwwroot\PHPTestSite\Untitled-5.php on line 2

Line 2 is :

<?php virtual('/Connections/test1.php'); ?>

Test1.php is the connection I created in Dreamweaver to my MySQL database.

I need to lock this thread because of the problem with papayas1's email being constantly resent. If you need any further help with this problem, please open a new thread.

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 ,
Jun 06, 2009 Jun 06, 2009

Copy link to clipboard

Copied

LATEST

Question assumed answered. Locking thread because of bouncing email.

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