Please Help Me...its urgent

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
ashutosh
Forum Newbie
Posts: 3
Joined: Sun Feb 21, 2010 10:01 am

Please Help Me...its urgent

Post by ashutosh »

Hi all,

Actually I am making a php search containing table of userid, . I have adopted the search querry and got the result as the user id, name, joinmonth, itname, intid. I want result in level wise as it is for a MLM company. 1st I want to search the userid month wise. Then also I have to again search the database (By which I have to make the search result as intid) again I want to search the database by the help of intid and also want to add the result that i get. I have used the following search code. Made the search twice. As it was for 10 times, I have used the code again and again and made the result. The source code I have given below. How ever I am not able to get the proper addition from the result. Its urgent. Please any body help me....!!!

my code for 1st level search



<?php
print "<b>"."LEVEL - 1"."</b>";
print "<br/>"."<br/>";
$searchQuery = mysql_query("SELECT * FROM `levelchart` WHERE UPPER(`intid`) LIKE
'%$newq%' ORDER BY `userid` DESC LIMIT 10");
while ($row =
mysql_fetch_assoc($searchQuery))
{
echo "<b>";
echo "User ID - :"."</b>";
echo stripslashes($row['userid']);
echo ", "."<b>"."Name - : "."</b>";
echo stripslashes($row['name']);
echo "</b>"."<br/>";
}

?>

Code for the 2nd level

<?php
print "<br/>"."<b>"."LEVEL - 2"."</b>";
print "<br/>"."<br/>";
$searchQuery = mysql_query("SELECT * FROM `levelchart` WHERE UPPER(`intid`) LIKE
'%$newq%' ORDER BY `userid` DESC LIMIT 10");
while ($row =
mysql_fetch_assoc($searchQuery))
{
$intid = stripslashes($row['userid']);
$searchQuery1 = mysql_query("SELECT * FROM `levelchart` WHERE UPPER(`intid`) LIKE
'%$intid%' ORDER BY `userid` DESC LIMIT 10");
while ($row =
mysql_fetch_assoc($searchQuery1))
{
echo "<b>";
echo "User ID - :"."</b>";
echo stripslashes($row['userid']);
echo ", "."<b>"."Name - : "."</b>";
echo stripslashes($row['name']);
echo "</b>"."<br/>";
}
}
?>

It that write ???? But how to add the result that I get from search querry???
Post Reply