MySQL EXISTS return 1 or 0

mysql, php, select

Solution

SELECT IF(EXISTS(...),1,0) AS result

Problem

How can I return the 1 or 0 as true and false for my select query? I've tried every combination of fetch_assoc, arrays, etc. It usually returns as null, which doesn't make sense. ``` $querydetails = "select exists (select * from customer_det where id = $uid)"; $resultdetails = mysql_query($querydetails) or die(mysql_error()); while ($row = mysql_fetch_assoc($resultdetails)) { $resultdetails1 = $row[0]; } ``` That's the latest version of my query. I guess it's not an array, but I'm not sure how to pull the value if there's no row to be named? This is a post question to my previous thread: MySQL Update WHERE

Original source

Related problems