hiiiii all
im really runnning into a problem z that :
i have an sql qry.. that says "select ID form xx where ID=xx " now .. when the user cliks on an ID of the result ..., i want it to rebuild the query, the prv one along with the additional selected ID in (OR ID=xx) further clik would add the prv qry along with the (OR ID=xx).. and so on ...
so i end up someting like this ....
select ID from xx where ID=xx OR ID1=xx OR ID1=xx Or etc...
incrementing the query 'the OR Clasue' on each click..
to see to what iam trying to say, please visit the site below:
http://brilliants.multimania.com/mytree1.php
-------- here z the source code ------
<table border=1 width=100%>
<tr>
<?php
#----- trying to make a tree-------- i wish!---
include("inc/globalvar.inc");
include("inc/dbshare.inc");
#-----connection -----------
$connection=connectMYSQL();
mysqldb();
#------------------
if ($CatLvlID=="")
{
$CatLvlID=0;
}
else
{
$CatLvlID = $CatLvlID;
}
$query="SELECT * FROM categories WHERE CatLvlID=$CatLvlID"; //Category Level ID
$or= " OR CatPrntID ='$CatPrntID'"; //Category Parent ID
$query .= $or;
$result = mysql_query($query);
echo "<br> excuted query $query<br>";
if(!$result)
{
echo mysql_error();
echo "<br> $query";
}
else
{
while ($record = mysql_fetch_array($result))
{
$CatID=$record[0]; //category id
$CatPrntID=$record[1]; //category parent id
$CatLvlID=$record[2]; //category level id
$CatNm=$record[3]; // category name
echo "<td>";
print("<a href=$PHP_SELF?CatLvlID=$CatLvlID&CatPrntID=$CatID>$CatID</a>");
print("catID: $CatID");
echo "</td>";
echo "<td>";
print("ParentID: $CatPrntID");
echo "</td>";
echo "<td>";
print("LevelID: $CatLvlID");
echo "</td>";
echo "<td>";
print("Name: $CatNm");
echo "</td>";
echo "</tr>";
}
}
echo "</table>";
mysql_close($connection);
?>
.......................................
thank you verrrrry much...