Hi,
I want to pull data from db, where sometimes all rows and sometimes rows matching given “username”.
Here is my code:
[code]
//Grab Username of who’s Browsing History needs to be searched.
if (isset($_GET[‘followee_username’]) && !empty($_GET[‘followee_username’]))
{
$followee_username = $_GET[‘followee_username’];
if($followee_username != “followee_all” OR “Followee_All”)
{
$query = “SELECT * FROM browsing_histories WHERE username = “$followee_username””;
$query_type = “followee_username”;
$followed_word = “$followee_username”;
$follower_username = “$user”;
echo “$followee_username”;
}
else
{
$query = “SELECT * FROM browsing_histories”;
$query_type = “followee_all”;
$followed_word = “followee_all”;
$follower_username = “$user”;
echo “all”;
}
}
When I specify a “username” in the query via the url:
browsing_histories_v1.php?followee_username=scottee_boy&page_number=1
I see result as I should. So far so good.
Now, when I specify “all” as username then I see no results. Why ? All records from the tbl should be pulled!
browsing_histories_v1.php?followee_username=followee_all&page_number=1
This query shouldv’e worked:
[code]
$query = “SELECT * FROM browsing_histories”;