php-general | 2005051
Date: 05/02/05
- Next message: James: "Re: [PHP] handling a user pressing browser's back button"
- Previous message: Matthew Weier O'Phinney: "[PHP] Re: just going with LIKE"
- Next in thread: Richard Lynch: "Re: [PHP] setting condition problem"
- Reply: Richard Lynch: "Re: [PHP] setting condition problem"
- Maybe reply: Mark Rees: "RE: [PHP] setting condition problem"
- Maybe reply: Mark Rees: "RE: [PHP] setting condition problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi all
i have a query that grabs records from the database, it works fine,
but i have a problem with acondition i want to set for it
the variable $Record[Relate] has 1 of 2 values, "self" or "share"
what i wanna do is that when the variable has the value "share" it do
check the records grabbed and get the other records that has the value
share and $Record[Title] the same and display them once,
i don't know how to start doing this,
can anyone guide me or tell me how to do it
thanks in advance
here is the query
<?
$Query = "SELECT ID FROM projects";
$Result= mysql_query($Query);
$Total_Numbers = mysql_num_rows($Result);
$StartingID=$_GET['StartingID'];
$StartingID = ($StartingID) ? $StartingID : 0; //if rec is passed in, use it,
$Row = array();
$Query = mysql_query("SELECT * FROM projects ORDER BY ID DESC LIMIT
$StartingID,$Items_Numbers");
$Num = mysql_num_rows($Query);
while ($Record=mysql_fetch_array($Query)){
$Record[ID] = stripslashes($Record[ID]);
$Record[User] = stripslashes($Record[User]);
$Record[Relate] = stripslashes($Record[Relate]);
$Record[Thumb] = stripslashes($Record[Thumb]);
$Record[Shot] = stripslashes($Record[Shot]);
$Record[Title] = stripslashes($Record[Title]);
$Record[Link] = stripslashes($Record[Link]);
$Record[Type] = stripslashes($Record[Type]);
$Record[Skill] = stripslashes($Record[Skill]);
$Record[Info] = stripslashes($Record[Info]);
$Record[Time] = stripslashes($Record[Time]);
$Record[Date] = stripslashes($Record[Date]);
$Record[Rate] = stripslashes($Record[Rate]);
$Record[Raters] = stripslashes($Record[Raters]);
$Row[] = $Record;
}
$Next = $StartingID+$Items_Numbers;
$Prev = $StartingID-$Items_Numbers;
?>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: James: "Re: [PHP] handling a user pressing browser's back button"
- Previous message: Matthew Weier O'Phinney: "[PHP] Re: just going with LIKE"
- Next in thread: Richard Lynch: "Re: [PHP] setting condition problem"
- Reply: Richard Lynch: "Re: [PHP] setting condition problem"
- Maybe reply: Mark Rees: "RE: [PHP] setting condition problem"
- Maybe reply: Mark Rees: "RE: [PHP] setting condition problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

