Page 1 of 1

Record retrieval using two fields

Posted: Fri Sep 13, 2002 4:00 pm
by rfigley
I'm currently using this query to retrieve a record to be deleted:

Code: Select all

<?php

$query = ("select * from tbl_members where phone = '$phone'");

?>
However I need to query for an additional field "chapter" to prevent multiple record retrieval. What is the correct syntax for this?

Posted: Fri Sep 13, 2002 4:04 pm
by Takuma
Do you mena like this?

Code: Select all

<?php
$query = ("select * from tbl_members where phone = '$phone' AND chapter = '$whatever'");
?>

Posted: Fri Sep 13, 2002 4:42 pm
by rfigley
Sorry, no I need a record that queries tbl_members where phone = number and tbl_chapter where chapter_name = chapter

Posted: Fri Sep 13, 2002 4:50 pm
by Takuma

Code: Select all

SELECT * FROM tbl_members WHERE tbl_members.phone = $number AND tbl_chapter.chapter_name = $chapter