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

Database/MYSQL/ACCESS/PHP

New Here ,
Oct 04, 2006 Oct 04, 2006
This is my first webpage based on data from a database.
I am using DW8 and the templates of the website are based on PHP, the main PHP page calling two "includes", one for the left menu and the other the main page, both straight HTML.
I have a database written in MS Access. During development I used a simple HTML page to display the contents of the database using a table with a repeat region. So I know I can connect to the database and I have the correct basic details to display the information. I was a little surprise when this HTML page could not be called (included) with the PHP command but then assumed the database must be in MYSQL for PHP to be happy. (Please let me know if this is wrong assumption).
I converted the database to MYSQL and wrote a simple PHP page to display the data. Again this works so again I know I can connect etc. However it does not work when I use this page as the "include" in the PHP template page.

Does anyone know where I have gone wrong?
The site is not yet live so I cannot give a URL .

For more background info; the main site has a left menu with associated data going in the centre. The pages in question forms the product section. I have a collapsable menu list on the left which is to call a new main section with a filtered list from the database. As a "chicken" way out , can anyone suggest a different way to do this, I have looked at creating a different main page for each selection in the menu list but this seems very long winded and perhaps just the ocassion to use a filtered database page.

TOPICS
Server side applications
365
Translate
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 ,
Oct 04, 2006 Oct 04, 2006
david@bridgemics.co. wrote:
> then assumed the
> database must be in MYSQL for PHP to be happy.

Wrong. PHP works with just about every database. However, the only
combination supported by Dreamweaver is PHP/MySQL. Nevertheless,
Dreamweaver won't object if you hand-code the necessary database connection.

> I converted the database to MYSQL and wrote a simple PHP page to display the
> data. Again this works so again I know I can connect etc. However it does not
> work when I use this page as the "include" in the PHP template page.
>
> Does anyone know where I have gone wrong?

That's like the classic question "How long is a piece of string?". It's
impossible to say without seeing the code.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
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 ,
Oct 04, 2006 Oct 04, 2006
Thank you,
can you give me a little info on hand coding the database connection?
Also, I am confused why a page written in HTML and works to extract data from the database doesn't work when called from a PHP page, surely the working code is still there.
Translate
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 ,
Oct 04, 2006 Oct 04, 2006
david@bridgemics.co. wrote:
> can you give me a little info on hand coding the database connection?

I have never used PHP to connect to Access, but a quick Google search
turned up the following instructions:

http://www.w3schools.com/php/php_db_odbc.asp

> Also, I am confused why a page written in HTML and works to extract data from
> the database doesn't work when called from a PHP page, surely the working code
> is still there.

In principle, a page that works correctly on its own should also work
when used as an include. If it doesn't work, the only conclusion is that
there's something wrong with your code.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
Translate
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 ,
Oct 04, 2006 Oct 04, 2006
LATEST
be sure the include file dose not contain any of the following tags:
<html>
<head>
</head>
<body>
</body>
</html>

Jeff

"david@bridgemics.co." <webforumsuser@macromedia.com> wrote in message
news:efvnmd$ciu$1@forums.macromedia.com...
> This is my first webpage based on data from a database.
> I am using DW8 and the templates of the website are based on PHP, the main
> PHP
> page calling two "includes", one for the left menu and the other the main
> page,
> both straight HTML.
> I have a database written in MS Access. During development I used a simple
> HTML page to display the contents of the database using a table with a
> repeat
> region. So I know I can connect to the database and I have the correct
> basic
> details to display the information. I was a little surprise when this HTML
> page
> could not be called (included) with the PHP command but then assumed the
> database must be in MYSQL for PHP to be happy. (Please let me know if this
> is
> wrong assumption).
> I converted the database to MYSQL and wrote a simple PHP page to display
> the
> data. Again this works so again I know I can connect etc. However it does
> not
> work when I use this page as the "include" in the PHP template page.
>
> Does anyone know where I have gone wrong?
> The site is not yet live so I cannot give a URL .
>
> For more background info; the main site has a left menu with associated
> data
> going in the centre. The pages in question forms the product section. I
> have a
> collapsable menu list on the left which is to call a new main section with
> a
> filtered list from the database. As a "chicken" way out , can anyone
> suggest a
> different way to do this, I have looked at creating a different main page
> for
> each selection in the menu list but this seems very long winded and
> perhaps
> just the ocassion to use a filtered database page.
>
>
>


Translate
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