Hi All,
So I am trying to create my own basic photography studio website…sort of a little project. I want to learn the language as best as I can but it is quite difficult as I am on my own studying this. I worked through a book "Sams Teach Yoursel PHP, MySQL, and Apache and now after finishing it I am working on my website. I am currently trying to create a FAQ page based on the seestore.php example that was in the book. I changed the code to work specifically for my needs and I have the example questions and answers etc in my database. The problem is it won’t work. I can see the other parts of that page i.e. the background color, navigation bar etc, but the actual questions and answer parts won’t work. Below is my code! If someone could help me it would be very much appreciated!
[code]
ul { list-style-type:none; margin:0; padding:0; overflow:hidden; } li { float:left; } a:link,a:visited { display:block; width:120px; font-weight:bold; color:#FFFFFF; background-color:#98bf21; text-align:center; padding:4px; text-decoration:none; text-transform:uppercase; } a:hover,a:active { background-color:#7A991A; }L. Mo's Photography
F.A.Q.
-
div.img
{
margin: 2px;
border: 1px solid #0000ff;
height: auto;
width: auto;
float: left;
text-align: center;
}
div.img img
{
display: inline;
margin: 3px;
border: 1px solid #ffffff;
}
div.img a:hover img {border: 1px solid #0000ff;}
div.desc
{
text-align: center;
font-weight: normal;
width: 120px;
margin: 2px;
}
[/code]
[php] <?php //connect to database $mysqli = mysqli_connect("localhost", "root", "", "photo studio"); $display_block = "Please select a category to view the relevant questions. "; //show categories first $get_cats_sql = "SELECT id, cat_title, cat_desc FROM faq_categories ORDER BY id"; $get_cats_res = mysqli_query($mysqli, $get_cats_sql) or die(mysqli_error($mysqli)); if (mysqli_num_rows($get_cats_res) < 1) { $display_block = "Sorry, no categories to browse. "; } else { while ($cats = mysqli_fetch_array($get_cats_res)) { $cat_id = $cats['id']; $cat_title = strtoupper(stripslashes($cats['cat_title'])); $cat_desc = stripslashes($cats['cat_desc']); $display_block .= "".$cat_title." Sorry, no questions in this category. "; } else { $display_block .= "
[/php]
Thanks a million in advance! I hope that I did the php/code marks correct! Leah |