Re: Non-Object errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Terion,

On Tue, Apr 28, 2009 at 1:14 PM, Miller, Terion <
tmiller@xxxxxxxxxxxxxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux