Winning information
$sql = "SELECT * from t_activity where memberid= ' $memberID '";
$res = $db->getdata ($sql);
while ($res)
{
- 1
}
$obj = Mysqli_fetch_object ($res);
?>
As above, after extracting the data from the database, how to loop output the desired data from the database result set in the HTML Li?
Reply to discussion (solution)
Winning information
GetData ($sql); while ($obj = Mysqli_fetch_object ($res)) {?>
- field;? >
Winning information
GetData ($sql); while ($obj = Mysqli_fetch_object ($res)) {?>
- field;? >
The great God is the great God! Worship!
There is one more question to ask:
$sql = "SELECT count (*) from t_activity where memberid= ' $memberID '";
$res = $db->execsql ($sql);
$num = Mysqli_num_rows ($res);
Ask MySQL, how to count the number of rows in the query (*), with the above method has not been successful!
Winning information
GetData ($sql); while ($obj = Mysqli_fetch_object ($res)) {?>
- field;? >
The great God is the great God! Worship!
There is one more question to ask:
$sql = "SELECT count (*) from t_activity where memberid= ' $memberID '";
$res = $db->execsql ($sql);
$num = Mysqli_num_rows ($res);
Ask MySQL, how to count the number of rows in the query (*), with the above method has not been successful!
What do $num print out?
Winning information
GetData ($sql); while ($obj = Mysqli_fetch_object ($res)) {?>
- field;? >
The great God is the great God! Worship!
There is one more question to ask:
$sql = "SELECT count (*) from t_activity where memberid= ' $memberID '";
$res = $db->execsql ($sql);
$num = Mysqli_num_rows ($res);
Ask MySQL, how to count the number of rows in the query (*), with the above method has not been successful!
What do $num print out?
Print out 1, but the database has 3
Print out 1, but the database has 3
Change Count (*) to *.
Or you can do it.
$row = Mysqli_fetch_row ($res); $num = $row [0];
Print out 1, but the database has 3
Change Count (*) to *.
Great God!
$num = Mysqli_fetch_row ($res);
echo $num [0];
Or
List ($num) = Mysqli_fetch_row ($res);
Or
$num = Crrrent (Mysqli_fetch_row ($res));