WordPress database error: [Table 'wp_comments' is marked as crashed and should be repaired]
SELECT ID, COUNT( comment_ID ) AS ccount FROM wp_posts LEFT JOIN wp_comments ON ( comment_post_ID = ID AND comment_approved = '1') WHERE ID IN (6) GROUP BY ID

Php Tutorials by PhpTutorialSite.com » PHP Commenting
Star Hoster
Photoshop Tutorials
Anonymous Web Surfing
Funny Jokes
Myspace Friends
Open Treasure Chest
Building in Paradise


November 30, 2005

PHP Commenting

Filed under: Intro PHP Tutorials — phpdeveloper @ 4:56 am

Commenting In PHP

The PHP comment syntax always begins with a special character sequence and all text that appears between the start of the comment and the end will be ignored by the browser.

PHP’s comments will not be displayed to your visitors when they visit the your page. The only way to view PHP comments is to open the PHP file for editing. This makes PHP comments only useful to PHP programmers.

< ?php
// This is an example of Comment
echo "Hello!";
?>

Output :

Hello World!

Notice that line with // will not executed because we commented them out with the single line comment. This type of line commenting is often used for quick notes about complex and confusing code or to temporarily remove a line of PHP code.

Multiple Line Comment

The multi-line PHP comment can be used to comment out large blocks of code or writing multiple line comments. The multiple line PHP comment begins with ” /* ” and ends with ” */ “.

PHP Code:
< ?php
/* This is an example of Multi line comment
echo "Hello!";
echo "Friend!";
/*
echo "How are you?";
?>

Output:

How are you?

Always have Good Commenting Practices

One of the best practices that I can recommend to new PHP programmers is use comments. So many people write complex PHP code but they do not put good comments or believe the commenting is not needed. But when the code becomes more complex one can find difficult to solve the errors.

Two or ten years later, when you look back at some code you have written, with comments, you can easily understand why you did it that way as opposed to another. You will also remember your code much better with comments. Comments also help others, if they have to edit your code in the future.

WordPress database error: [Table 'wp_comments' is marked as crashed and should be repaired]
SELECT * FROM wp_comments WHERE comment_post_ID = '6' AND comment_approved = '1' ORDER BY comment_date

WordPress database error: [Table 'wp_comments' is marked as crashed and should be repaired]
SELECT COUNT(*) FROM wp_comments WHERE comment_post_ID = '6' AND comment_approved = '1'

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.