读取一条记录数据里边所有字段:比如,读取一条新闻,读取出标题、内容、时间、作者
php版本5.6以上 MySQLi语句
- $sql2 = "Select username FROM date_manage where id=".$id;
- $result = mysqli_query($conn, $sql2);
- $v_result = mysqli_fetch_assoc($result);
- $username=$v_result['username'];
- mysqli_close($conn);