Re: Non-Object errors

From: Date: Tue, 28 Apr 2009 17:30:13 +0000
Subject: Re: Non-Object errors
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-292093@lists.php.net to get a copy of this message
On 4/28/09 12:27 PM, "Lex Braun" <lex.braun@gmail.com> wrote: 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 OH Ah ha bet that's it!! I hope!!

« previous php.general (#292093) next »