Results 1 to 2 of 2

Thread: Php Classess...db Query

  1. #1
    Join Date
    May 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Php Classess...db Query

    Hi...

    I start with DB first

    var $member_table = "member_log";
    -consist of lid,Uid,action,ctime,ldesc,ip
    var $member_info_table = "member_info";
    -consist of member_id,name,location
    where (Uid=member_id)

    The Code Currently querying only member_table
    PHP Code:
    function search_Log_Query() {

    $use_where_stmt false;
    $this->strQuery " Select action, ldesc, ctime , ip FROM " $this->member_table ."" ;

    if (
    strlen($this->l_desc) != 0){ 
    if (
    $use_where_stmt) {
    $this->strQuery .= " and ";
    } else {
    $this->strQuery .= " WHERE " 
    $use_where_stmt true ;

    $this->strQuery .= " ldesc like '%" $this->l_desc "%'"
    $use_where_stmt true 



    Question....i need to retrieve also some data from member_info_table....which is location.So i need only JOIN query only n how should do it in this line? :

    PHP Code:
    $use_where_stmt false;
    $this->strQuery " Select action, ldesc, ctime , ip FROM " $this->member_table ."" 

    Regards
    Poyor7

  2. #2
    Join Date
    Dec 2005
    Posts
    49
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by poyor7
    PHP Code:
    $use_where_stmt false;
    $this->strQuery " Select action, ldesc, ctime , ip FROM " $this->member_table .", member_info_table" 
    add in the other field names that are in the member_info_table after "ip" and it should work

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •