Jump to content


Photo

using SELECT command.


  • Please log in to reply
2 replies to this topic

#1 aleminio

aleminio
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 26 July 2006 - 07:45 PM

logical, here is what i need to write:
Select * from $log where date = $date AND [ ( name1= $n1 AND name2 = $n2) OR (name1 = $n2 AND name2 = $n2)] 

how can i write it as php select command?

#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 26 July 2006 - 07:49 PM

logical, here is what i need to write:

Select * from $log where date = $date AND [ ( $n1=name1 and $n2 =name2) OR ($n2=name1 and $n2 = name2) ] 

how can i write it as php select command?


where $date is in YYYY-MM-DD format:
<?php
$sql = "SELECT * FROM $log WHERE date = '$date' AND ((name1 = '$n1' AND name2 = '$n2) OR (name1 = '$n2' AND name2 = '$n1'))";
?>

You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 aleminio

aleminio
  • Members
  • PipPip
  • Member
  • 13 posts

Posted 26 July 2006 - 07:52 PM

the date is Y n j
and thanks.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users