mysqli查询

$result=$con->query($myquery);
记录数:$result->num_rows;
字段数:$result->field_count;
获取字段信息:$result->fetch_field;field信息如下:
Attribute Description
name The name of the column
orgname Original column name if an alias was specified
table The name of the table this field belongs to (if not calculated)
orgtable Original table name if an alias was specified
def The default value for this field, represented as a string
max_length The maximum width of the field for the result set.
flags An integer representing the bit-flags for the field.
type The data type used for this field
decimals The number of decimals used (for integer fields)
获取记录:$result->fetch->array();然后可用row[i],i<$result->field_count取之

posted by xiaohuiyan @ 16:42:00,


php常量

__FILE__:文件名
__LINE__:行号
PHP_VERSION:php的版本号
PHP_OS:当前操作系统名称
TRUE:真 FLASE:假
E_ERROR:最近的错误处
E_WARNING:最近的警告处
2.php对默认对变量的大小写敏感,但对函数名和关键字的大小写不敏感

posted by xiaohuiyan @ 16:40:00,


csu2

budding...

posted by xiaohuiyan @ 14:44:00,