Forum Moderators: coopster
select bus_name, first_name, last_name, fax,user_name from bol_ag where fax like fax
I need to select only businesses that have entered a fax number
fax has been set to null
I tried many flavors of "like" and "where"
but still grab the empty fields along with the fax number provided
how can I weed out of my list fax empty data
thanks
regards
Henry
I modified your where statement to look for an exact match. If you want it to look for similar fax numbers then:
WHERE fax LIKE '$fax' AND fax <> '';
This is from memory (no testing and no coffee) so you'd best take a look at the string comparison [mysql.com] and comparison operators [mysql.com] pages at MySQL[/url] to be sure.
one is part of an "enter data script"
$fields_displayed = array(bus_name, first_name, last_name, fax,user_name);
$fields_displayed_list = "bus_name, first_name, last_name, fax,user_name";
and then I generate a CVS report with the entered data:
if (isset($data))
{
if ($data=="display")
$report_string .= "bus_name, first_name, last_name, fax,user_name\n";
$query="select bus_name, first_name, last_name, fax,user_name from bol_ag where fax like fax ";
$data = $the_db -> selectquery($query);
create_report();
}
etc....
well that was two years ago
now I offer a regular form that pass $this and that ...
but I have 2000 ref in that sector so I cannot modif in depth.
but still need to generate a report with existing fax #
WHERE fax IS NOT NULL or WHERE fax IS NOT 'NULL' will yield all records where the field is filled in with a default NULL
WHERE fax IS NOT '' will yield all records where the field is not empty