Hi,
I am building a database driven web site using Oracle and php....thus all of the content that I need has to be extracted from the database, including the text and links for the menu buttons...
i have figured out how to create the buttons using a CSS. However, when I try to get the content from the database (buttontext and link) but when i do this the buttons disappear. Since my site is db driven, i need each button to be created dynamically, so that someone can add new menu items to the db and they are automatically created the next time the page loads.....here is the code that i am not able to get working....
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<STYLE TYPE="text/css">
<!--
#mybutton {border-style: inset;
border-color: #7ea8cf;
background-color: #224059;
text-decoration: none;
width: auto;
text-align: center;}
A.buttontext {color: white;
text-decoration: none;
font: 12pt Verdana;
cursor: hand;}
-->
</STYLE>
</head>
<body>
<body>
<?php
//includes database logon information
require('db-include.inc');
//select all of the data from Business Section
$stmt = OCIParse($connection, "SELECT *
FROM BUSINESS_SECTION
ORDER BY BUSINESS_SECTION_NAME");
OCIExecute($stmt);
// Start of table and column headings (Name)
// print "<TABLE CELLSPACING=\"0\" CELLPADDING=\"2\" BORDER=\"0\">\n";
?>
<table border=0 >
<tr>
<?
// Loop through results
while(OCIFetch($stmt))
{
//Assign variables from the database
$link = OCIResult($stmt, 'BUSINESS_SECTION_LINK') ;
$bname = OCIResult($stmt, 'BUSINESS_SECTION_NAME') ;
?>
<td><a href = <? '$link' ?> CLASS = "buttontext">
<div id = "mybutton">
<? $bname ?>
</div></a></td>
<?
}
?>
</tr>
</table>
<?
// As always, free the resources.
OCIFreeStatement($stmt);
OCILogoff($connection);
?>
<p> </p>
</body>
</html>
maybe i am mixing the html and php the wrong way??
i hope someone can help!!
thanks
sp