Obtain a single website comment and output it in an array. Outputs a single website comment in the form of an array. in the original library function of a single array, the method for displaying a single comment is not obtained. add the following publicstaticfunctionsingle ($ id) {globa gets a single website comment and outputs it in an array.
In the original library function, the method for displaying a single comment is not obtained. add the following:
public static function single($id){global $db;return $db->query("SELECT * FROM `{$db->prefix}comment` WHERE `id` = '{$id}'",1);}
Output array, which can be called in the template
Assign values to array a and output the elements in all arrays in the form of five data entries per row.
# Include "stdio. h"
Main ()
{
Int a [20], I; // assume that the array is 20 elements.
For (I = 0; I <20; I ++)
Scanf ("% d", & a [I]); // the array elements are input by the keyboard.
For (I = 0; I <20; I ++)
{
Printf ("% 5d", a [I]);
If (I % 5 = 0)
Printf ("/n"); // if the number is 5, a line break is output.
}
}
How to output an array
I don't know the specific request function, but it's easy to use js.
In the original library function, the method for displaying a single comment is not obtained. add the following public static function single ($ id) {globa...