Re: Non-Object errors
| From: | Lex Braun | Date: | Tue, 28 Apr 2009 17:27:58 +0000 |
| Subject: | Re: Non-Object errors | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292092@lists.php.net to get a copy of this message | ||
Terion,
On Tue, Apr 28, 2009 at 1:14 PM, Miller, Terion <
tmiller@springfi.gannett.com> wrote:
> Here is my code now:
> $query = "select name, age, warrant, bond, wnumber, crime FROM warrants
> where ".$warranttype." = ".$warranttype." OR ".$searchname." =
> ".$searchname." "; $result = mysql_query($query); $row =
> mysql_fetch_assoc($result); $num_results = mysql_num_rows ($result);
> Should this post of gone on the Db list maybe?
>
One thing I noticed about your code above has to do with your WHERE clause.
Say,
$warranttype = 'warrant'
$searchname = 'Terion'
Your $query will become:
SELECT name, age, warrant, bond, wnumber, crime
FROM warrants
WHERE warrant = warrant OR Terion = Terion
The first time you use $warranttype and $searchname should be the column
names rather than the value you would like that column to be equal to.
-- Lex