PDA

View Full Version : Basic Help ASAP- Dreamweaver - php ?


bvanpelt
05-06-2009, 03:51 PM
Hi everyone, I am a nube to this, so be patient with me.

I am using Dreamweaver, PHP, and MySql
Here is my set up

Domain - remotly hosted
MySql - remotly hosted
Dreamweaver - connects OK to to Domain
MySql - Database set up
Created base HTML website in Dreamweaver, and works OK on Domain
Created php script to access Mysql Table. works ok when executed stand alone. Displays table and data properly

The problem

When I add the php to my html, nothing happens ?????? It does not run at all. no error message, no data displayed. Do I have it backwards ? Is there anyone who can send me the proper example of how to use dreamweaver,php and html ?
This is the code I have in my Dream Weaver Page. I have it as an .html


<?php
$connection = mysql_connect('XXX', 'Orion001', 'password');
mysql_select_db("Orion001", $connection);
$result = mysql_query ("select * FROM ccw_skills", $connection);
While ($row = mysql_fetch_array($result, MYSQL_NUM))
{
foreach ($row as $attribute)
print "{$attribute} ";
print "\n";
}
mysql_close($connection);
?>

domedia
05-06-2009, 04:14 PM
You cannot put PHP in .html pages.

bvanpelt
05-06-2009, 04:44 PM
ok thanks, I renamed the extension from .html to .php and its working.