|
Posted by Bob Sanderson on 03/22/06 22:55
I am using the following query to generate a web page. Searchterm is
derived from a search form.
$query="select * from jobs, items where jobs.JobNumber like '$Searchterm'
and items.JobNumber like '$Searchterm'";
The data from the jobs table goes in a general form describing a specific
job. The data from the items table goes in a separate form which lists all
of the items associated with that job. This works fine if there is data for
the selected job number in both tables but in some cases, the data only
exists in the jobs table - there is no corresponding data in the items
table. What I would like in that case is to output the jobs table data and
simply leave the items output blank, but since there are no records meeting
the criteria of the query, nothing is selected.
Is there a way to create a query so that it will do what I want. If not,
can it be done with an either/or statement?
Any help will be greatly appreciated.
Navigation:
[Reply to this message]
|