jumpenjuhosaphat Posted January 26, 2007 Share Posted January 26, 2007 Is it possible. Say I have a function....distance_between, which takes 2 postal area strings and returns a number that represents the distance between to locations. Could I then use that function within a string like follows:[code]SELECT * FROM ads WHERE distance_between(location1, location2)<500[/code]It should be noted that location1 is a value that should be pulled out of the table while doing the query, and location2 is predetermined by the user. Link to comment https://forums.phpfreaks.com/topic/35777-using-php-functions-in-a-query-string/ Share on other sites More sharing options...
hvle Posted January 26, 2007 Share Posted January 26, 2007 no man, you can not do that. However, you can add a function into mysql for it to work with mysql.This function must be written in C/C++, and technically, I have never done anything like this but you can research it here:http://dev.mysql.com/doc/refman/5.0/en/adding-udf.html Link to comment https://forums.phpfreaks.com/topic/35777-using-php-functions-in-a-query-string/#findComment-169548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.