I am calling on some information in a database that has number signs, but I'm getting errors. $res = mysql_query("select * from properties where approved=1 and location2 in (1#50#45,1#50#17) order by date_added desc limit ".$start_ad.",".$limit) or die("could not query for ".mysql_error()); PHP: How can I make it so that it will accept those number signs?
You can try one of these for the pound sign. & # 35; (without spaces) OR # You probably should have the HTML Entity notation in your query and in your database data.
None of this stuff has worked. It basically stops at the # and won't display the results of the location2 field. There must be a way to have it recognize # as a # only in this case.
I am not exactly sure what this value (1#50#45,1#50#17) is supposed to represent, but sense it contains more than numeric characters, it must be treated as a string and quoted in the query. $res = mysql_query("select * from properties where approved=1 and location2 in ('1#50#45,1#50#17') order by date_added desc limit ".$start_ad.",".$limit) or die("could not query for ".mysql_error()); PHP:
That worked! Thank you. When it was mentioned before by Cloud Computing Forum, I thought he meant 1'#'50'#'45 so they would only be around the number signs.