Are there any existing solutions that use this SQL Keyword?
I am a humble supplicant...
I am not looking to promote myself, just looking to support the community and moving to improve the use of mapping.
Okay, so you're a rocket scientist!?
Sorry, but I couldn't prevent your post reminding me spontaneously on Shania Twain's That don't impress me much 😂
Thank you for your quick response!
I did not install the code I altered. I created it to respond to the question asked by Michael.
I appreciate your advice.
Please don't edit core files that is why you were getting those errors on your installation. Simply use a Plain SQL and no need to edit OSSN files please it takes long time to find out the changes caused issue.
$database = new OssnDatabase();
$database->statement("Your plain query goes here");
$database->execute();
$result = $database->fetch(true);
var_dump($result);
Certainly. I code missing in ossn/classes/OssnDatabase.php to handle that keyword. I attach my suggested fix from line 269. This would allow me to create an SQL query from code like this (which you may recognise as Haversine formula for MySQL):
sql = "SELECT t.upl_item, t.upl_dodl AS dodl, t.upl_lastupdate AS lastupdate, CONCAT(t.upl_width, '|', t.upl_height) AS itsize, t.upl_ext, itm_id, itm_title, itm_desc, CONCAT(t.upl_width, '|', t.upl_height) AS imgsize, CONCAT(t.upl_path, t.upl_name, t.upl_ext) AS img"
if(dist > 0 && lat > 0 && lng > 0)
sql += ", 3956*2*ASIN(SQRT(POWER(SIN(("+lat+"-"+itm_lat+")*pi()/180/2),2)+COS("+lat+"*pi()/180)*COS("+itm_lat+"*pi()/180)*POWER(SIN(("+lng+"-"+itm_lng+")*pi()/180/2),2))) AS distance"
sql += " FROM mgr_item_search, "+table+" t "
if(feedtable.length > 0) sql += feedtable
sql += " WHERE t.upl_item = itm_id AND"
if(feedtable.length == 0) sql += " t.upl_user_id = "+mem_id+" AND"
sql += " t.upl_folder = "+fld+" AND t.upl_del = 0"
if(kws.length > 0)
sql += " AND MATCH(itm_title,itm_desc) (AGAINST ? IN BOOLEAN MODE)"
if(loc > 0) sql += " AND itm_location = "+loc
if(dist > 0 && lat > 0 && lng > 0)
sql += " AND itm_lng BETWEEN "+long1+" AND "+long2+" AND itm_lat BETWEEN "+lat1+" AND "+lat2+" HAVING distance <"+ dist
Can you please explain WHAT is showing you that upgrade of the select function is necessary for you, Peter?
And what code you'd like to add in order to achieve what?
I think that shows me that an upgrade to the public function select in classes/OssnDatabase.php is necessary for me.
With all due respect, I find the easiest way to illustrate the syntax is to point you at this page.
https://www.mysqltutorial.org/mysql-having.aspx
or
https://www.w3schools.com/mysql/mysql_having.asp
Not exactly sure what you mean by it.
Due to the many requests in the past for additonal features and components we have decided to develope a premium version. Features like Hashtags, Videos, Polls, Events, Stories, Link Preview, etc included in it.
$199 (Life Time)