making a basic PHP blog...What am I doing wrong?

Tara D

New member
I am not sure why it doesn’t show up on the page. It does post on my hosting server when I fill in the information, but it doesn’t show up on the page. I guess it’s not putting the database info on the web page and I am not really understanding what I am doing wrong. I just graduated and still kinda learning so. :-S The website is taraleedesigns.com/blog.php also yahoo made me remove some links but it was just doctype and stuff


blog.php code:

<?php

$connectID = mysqli_connect("mysql8.000webhost.com", "a6964267_taralee", "mypassword",
"a6964267_taralee") or die ("connect-unable to connect to the database.");

if ($_GET['delete_id']) {
$id = ($_GET['delete_id']);

$success = mysqli_query ($connectID, "DELETE FROM ref_links WHERE id = $id")
or die ("Unable to delete record from database");
if ($success) {
print "Record successfully deleted";
}
}

?>

?>



<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>TaraLeeDesigns - Blog</title>
<!--the layoout and text stylesheets-->
<link href="3_col.css" type="text/css" rel="stylesheet" />
<link href="text_n_colors.css" type="text/css" rel="stylesheet" />

<style type="text/css">
<!--
#apDiv1 {
position:absolute;
left:158px;
top:71px;
width:457px;
height:420px;
z-index:1;
}
.style1 {color: #f6bbd5}
.style3 {font-size: xx-small
}
.style4 {font-family: Harrington}
-->
</style>
</head>


<body class="violet">
<div id="main_wrapper">
<div id="header">
<div id="header_inner">
<h1 class="style4"><a target="_blank"><img <meta name="keywords" content="taraleedesigns, tara lee, tara degenstein, web developement, tech support, north dakota, bismarck, web design" />
<meta name="description" content="This site is a portfolio. Has information about me and what I have done. I recently graduated college with an AAS..." />
</h1>
<h1 class="style4">Tara Lee Designs </h1>
</div>
<!-- end header_inner -->
</div>
<!-- end header -->

<div id="nav">
<div id="nav_inner">
<ul>
<li><a href="index.php">Home</a></li>
<li><a href="portfolio.php">Portfolio</a></li>
<li><a href="made.php">Pages
Made</a></li>
<li><a href="fav.php">Fav.
Pages</a> ></li>
<li><a href="find.php">Find
Me</a></li>
<li><a href="resume.php">Resume</a></li>
<li><a href="blog.php">Blog</a></li>
<li><a href="contact.php">Contact
Me</a></li>
<li><a href="map.php">Site
Map </a></li>
<li></li>
</ul>
</div>
<!-- end nav_inner -->
</div><!-- end nav -->
<div id="content">
<div id="content_inner">
<p>You are here:
<a href="blog.php">Blog</a></p>
<p> Coming Soon!</p>
<p><a href="add.php">Add new link</a><br />
<a href="links.php">View listings page</a></p>
<?php
if ($_GET['added']) print '<p style="color:red; font-weight: bold;">Record successfully created!</p>';
if ($_GET['updated']) print '<p style="color:red; font-weight: bold;">Record successfully updated!</p>';

//query the database
$myResult = mysqli_query($connectID, 'SELECT ref_links.*, ref_categories.category_name FROM ref_links, ref_categories WHERE ref_links.ref_categories_id=ref_categories.id')
or die ("Unable to select from database");
//loop through the returned records

print '<table>'."\n";
while ($row = mysqli_fetch_array($myResult, MYSQL_ASSOC)) {
//category heading only written out if a listing is in diff cat from previous listing
//$thisCat is used to test if a new heading needs to be written out
$thisCat= $row['category_name'];
if ($lastCat<>$thisCat) { // true first time($lastCat not set), and each time a new category is found
//then write out a table heading with the category name
print '<th colspan="6" align="left">'; //heading spans all columns of table
print "<h3>".$row['category_name']."</h3>"; // print the next category heading
print "</th>\n";
}
print '<tr>';

print '<tr>'."\n";
print '<td>'.$row['topic_name'].'</td>'."\n";
print '<td class="description">'.$row['topic_desc'].'</td>'."\n";
//Here I trim the displayed URL down to 30 chars (0 thru 30)
//otherwise long URLs force the table to be very wide
print '<td><a href="'.$row['topic_url'].'">'.(substr($row['topic_url'],0,29));
//add ellipsis if URL is trimmed (> 30 chars)
if ((strlen($row['topic_url']) > 30)) {print "…";}
print'</a></td>';
$id=$row['id'];
print '<td><a href="add.php?modify_id='.$id.'">Edit</td>';
print '<td><a href="';
print ($_SERVER['PHP_SELF']);
print '?delete_id='.$id.'">Delete</a></td>';
print '</tr>'."\n";
// finally, we store the current category so next time the loop repeats,
// we can tell if the next item is in a new category or not
// if so, we write out a new heading- see if ($lastCat<>$thisCat) above
$lastCat = $row['category_name'];
}

print '</table>'."\n";
?>
<p>Â*</p>
<a href
Well yahoo cut off most of the code so I guess if you have any idea or advice that would be greatly appreciated also I could always like email it to you or something if you think you can help me. Thanks much!
 
Back
Top