View Full Version : how to search a column in MySQL (return boolean)
09-04-2006, 01:29 AM
trying to search a column in MySQL and returning a boolean result. How do I do this?
Like say search for $string=mice in column='food' of table 'dog'.
09-04-2006, 04:46 AM
You won't get a boolean result back, but you can "force" a boolean result by checking the number of rows your query returns and if it's > 0 then return "true".
Or are you asking what the syntax is for the query?
09-04-2006, 04:54 AM
thanks I got it. You're right. Just check the result and execute based on the mysql_num_rows command.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.