Jump to content

multi table search


adzie

Recommended Posts

hi, this script is designed to place information into a xml file.

 

It transfers the information  from the members database fine, but I was hoping for the group field to display the record it matches under the groups database ie member group = groups ID

 

any thoughts?

 

 

 

$query = "SELECT * FROM member_locations WHERE last_update > DATE_SUB( NOW() , INTERVAL 5 MINUTE ) ORDER BY number";

$result = mysql_query($query);

 

 

$number = mysql_numrows($result);

 

 

if ($number > 0)

{

 

      for ($i=0; $i<$number; $i++)

        {

                  $number = mysql_result($result,$i,"number");

                  $town = mysql_result($result,$i,"town");

                  $data['county'] = mysql_result($result,$i,"county");

                  $type = mysql_result($result,$i,"type");

 

              $query = "SELECT * FROM members WHERE `member_number` ='$number'";

              $getnam = mysql_query($query);

              if (mysql_numrows($getnam) > 0) {

              $data['title'] = mysql_result($getnam,0,"name");

              $group ['group'] = mysql_result($getnam,0,"group");

                 

 

}

              else{$data['title'] = "No Member Number";

 

                    }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.