KLoning Spoon

By creating a MySQL CRUD class you can easily create, read, update and delete entries in any of your projects, regardless of how the database is designed

The idea here is to give readers the ability to navigate around your site. You want organized content. You want content that’s linked together in meaningful ways. Custom taxonomies allow us to group our content in ways that simple categories and tags can’t

<?php
$columns = 4;		// The number of columns you want.

echo "<table>";		// Open the table

// Main printing loop. change `30` to however many pieces of data you have
for($i = 0; $i < 30; $i++)
{
	// If we've reached the end of a row, close it and start another
	if(!($i % $columns))
	{
		if($i > 0)
		{
			echo "</tr>";		// Close the row above this if it's not the first row
		}
		
		echo "<tr>";	// Start a new row
	}
	
	echo "<td>Cell</td>";		// Add a cell and your content
}

// Close the last row, and the table
echo "</tr>
</table>";
?>
<?php
$rows
= 10;     // The number of columns you want.
$numItems
= 30;     // Number of rows in each column

// Open the first div. PLEASE put the CSS in a .css file; inline used for brevity
echo
"<div style=\"width: 150px; display: inline-block\">";

// Main printing loop.
for($i = 0; $i < $numItems; $i++)
{
   
// If we've reached our last row, move over to a new div
   
if(!($i % $rows) && $i > 0)
   
{
        echo
"</div><div style=\"width: 150px; display: inline-block\">";
   
}

    echo
"<div>Cell $i</div>";      // Add a cell and your content
}

// Close the last div
echo
"</div>";
?>


Output:

<table><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td><td>Cell</td><td>Cell</td></tr><tr><td>Cell</td><td>Cell</td></tr>
</table>


<?php
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
comment_post_ID, comment_author, comment_date_gmt, comment_approved,
comment_type,comment_author_url,
SUBSTRING(comment_content,1,30) AS com_excerpt
FROM $wpdb->comments
LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
$wpdb->posts.ID)
WHERE comment_approved = '1' AND comment_type = '' AND
post_password = ''
ORDER BY comment_date_gmt DESC
LIMIT 10";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
$output .= "\n<ul>";
foreach ($comments as $comment) {
$output .= "\n<li>".strip_tags($comment->comment_author)
.":" . "<a href=\"" . get_permalink($comment->ID) .
"#comment-" . $comment->comment_ID . "\" title=\"on " .
$comment->post_title . "\">" . strip_tags($comment->com_excerpt)
."</a></li>";
}
$output .= "\n</ul>";
$output .= $post_HTML;
echo $output;?>

Monthly Posts Rate, Names and E-mails of Everybody Who Has Ever Commented, Monthly Comments Rate, What Time Do People Comment?, Most Popular (Top 10) Commenters

The majority of reported WordPress database security attacks were performed by exploiting SQL Injection vulnerabilities. By renaming the WordPress database table prefixes you are protecting your WordPress blog and website from zero day SQL injections attacks.