Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6233061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:13:51+00:00 2026-05-24T10:13:51+00:00

I’m trying to pull data from 2 tables and when I add this in

  • 0
  1. I’m trying to pull data from 2 tables and when I add this in the $query, the results are all messed up when I click my link ex. /leads.php?contactstatus=Hot

  2. How can I by default display all contactstatus types when I only have “Hot” “Warm” “Cold” as options in the table row contactstatus?

    <?
    mysql_connect ("xxxx","xxxx","xxxx") or die ('Error: ' .mysql_error());
    mysql_select_db ("xxxx");
    
    if(isset($_GET['contactstatus'])
    && in_array($_GET['contactstatus'], array('Hot', 'Warm', 'Cold'))){     
    $status = $_GET['contactstatus']; 
    } 
    else {      
    $status = ''; // what do I put here so by default users for all contactstatus types show in results 
    }  
    
     $query = "SELECT * FROM contacts,contacttodo WHERE contacts.contactstatus =    `'".$status."' OR contacttodo.type = 'Appointment'";`  
    
    $result=mysql_query($query);
    
    while($row = mysql_fetch_array($result)){
    
    ?>
    

UPDATE:

This works:

<div class="nav">
<table width="100%">
<tr>
<td>
<li><a href="/dbs/a.php?type=Appointment">Appointments</a></li> 
<li><a href="/dbs/a.php?contactstatus=Hot">Hot</a></li> 
<li><a href="/dbs/a.php?contactstatus=Warm">Warm</a></li> 
<li><a href="/dbs/a.php?contactstatus=Cold">Cold</a></li>
</td>
</tr>
</table>
</div>

$status = ''; 
$todotype = '';  

if(isset($_GET['contactstatus']) 
&& in_array($_GET['contactstatus'], array('Hot', 'Warm', 'Cold')))
{     
$status = $_GET['contactstatus'];     
 $query = "SELECT * FROM contacts,contacttodo,contactnotes WHERE contacts.ID = contacttodo.contacts_id = contactnotes.contacts_id AND contacts.contactstatus = '".$status."' ORDER BY contacts.firstname ASC"; 
}  

if(isset($_GET['type']) 
&& in_array($_GET['type'], array('Appointment', 'Email', 'Call')))
{     
$todotype = $_GET['type'];     
$query = "SELECT * FROM contacts,contacttodo,contactnotes WHERE contacts.ID = contacttodo.contacts_id = contactnotes.contacts_id AND contacttodo.type = '".$todotype."' ORDER BY contacts.firstname ASC"; 
} 
$result=mysql_query($query);

while ($row = mysql_fetch_array($result)) {

<div id="contact-results">
<table width="100%" cellspacing="0" cellpadding="0" class="contact-results"> 
<tr>
<td align="left" width="15%"><a href="/dbs/editcontact.php?ID=<? echo $row['ID']; ?>"><strong><? echo $row['firstname']; ?> <? echo $row['lastname']; ?></strong></a></td>
<td align="left" width="5%"><? echo $row['contactstatus']; ?></td>
<td align="left" width="15%"><? echo $row['contacttype']; ?></td>
</tr>
</table>
</div>
<?
}
mysql_close();
?>

By default how can I display all ‘Hot’ ‘Warm’ ‘Cold’ leads?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:13:52+00:00Added an answer on May 24, 2026 at 10:13 am

    try

    if(isset($_GET['contactstatus']) && in_array($_GET['contactstatus'], array('Hot', 'Warm', 'Cold')))
    {
      $status = contacts.contactstatus = '".$_GET['contactstatus']."' ; 
    } 
    else 
    {       
     $status = '0'; 
    }
    
    $query = "SELECT * FROM contacts,contacttodo WHERE contacttodo.id =  contacts.id AND (  ".$status." OR contacttodo.type = 'Appointment')";
    

    The contacttodo.id = contacts.id need to be updated for your structure

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.