Counting members from MySQL
Posted: 24 Aug 2017, 09:42
Chef i`m back hoping you could help me with this.
i think i need just one example then i can build a score-board for the members...
I have two examples where i want to make a count from both variables i would like to have a count-up +
And:
Edit:
Strange i searching the whole day, but counters like + - * i can`t find them
But this one is also funny what i found & gonna use:
Still i hope you have a answer for me (example).
i think i need just one example then i can build a score-board for the members...
I have two examples where i want to make a count from both variables i would like to have a count-up +
Code: Select all
<?php
include('connection.php');
$result = $conn->query("SELECT COUNT(*) FROM `addon_message` WHERE friend_id='$users[id]'");
$row = $result->fetch_row();
echo ' ', $row[0];
?>
Code: Select all
<?php
include('../connection.php');
$result = $conn->query("SELECT COUNT(*) FROM `member_access` WHERE user_id='$users[id]'");
$row = $result->fetch_row();
echo ' ', $row[0];
?>
Strange i searching the whole day, but counters like + - * i can`t find them
But this one is also funny what i found & gonna use:
Code: Select all
<?php
$mystring = $row1[0];
$findme = '8';
$pos = strpos($mystring, $findme);
// Note our use of ===. Simply == would not work as expected
// because the position of 'a' was the 0th (first) character.
if ($pos === false) {
echo "";
} else {
echo "Active Member";
echo "Great Score";
}
?>