Hey, How is everyone doing. I am in the midst of working on CMS and things are going well, considering my knowledge level of php.
I am able to login and add to my Mysql database but when I go display the data, it tells me there is no content items. When, I check my database they are in there but it will not display them. This might be an easy solution that I am not seeing but I have combined through code several times and I am not seeing what is wrong.
As always any suggestions for getting this to display would be greatly appreciated.
Best to you all - here is the code that I am using to display the data. Thanks:
case "department":
$dept_id = $_GET['dept_id'];
$sql = "SELECT name, dept_id, description
FROM Department
WHERE dept_id = $dept_id ORDER BY name";
$results = @($sql,$connection);
$row = @mysql_fetch_assoc($results);
$dept_name = $row['name'];
$dept_desc= $row['description'];
$page["left_nav"] = "$dept_name Content";
$page["body_text"] = "$dept_name - $dept_desc";
$sql = "SELECT a.name, a.type_id,
count(b.content_id)
FROM Content_Type a
LEFT OUTER JOIN Content b on
a.type_id = b.content_type
and b.dept_id = $dept_id
GROUP BY a.name, a.type_id ORDER BY name";
$results = @mysql_query($sql,$connection);
$body_links = "";
while($row = @mysql_fetch_assoc($results))
{
$link = "$base_url?dept_id=$dept_id"
. "&type_id=" . $row['type_id']
. "&browse_level=content";
$page["left_nav_links"][$link] = $row['name'];
$body_links .= "<li><a href=\"" . $link
. "\">" . $row['name'] . "</a>";
}
$page["left_nav_header"] = "Content Index";
$page["top"] = $dept_name;
$page["body_text"] = "$dept_name - $dept_desc "
. "<p>Vist the departments' "
. "areas: $body_links";
$trail .= " - <a href='$base_url?dept_id=$dept_id"
. "&browse_level=department'>$dept_name</a>";
break;
case "content":
$dept_id = $_GET['dept_id'];
$type_id = $_GET['type_id'];
$sql = "SELECT a.name, a.type_id, b.title,
b.description, b.content_date,
b.create_date, b.created_by,
b.last_upd_date, b.last_upd_by,
c.name as dept_name, content_id
FROM Content_Type a, Department c
LEFT OUTER JOIN Content b on
a.type_id = b.content_type
and a.type_id = b.content_type
and b.dept_id = $dept_id
and b.content_type = $type_id
WHERE c.dept_id = $dept_id
ORDER BY content_date DESC";
$results = @mysql_query($sql,$connection);