I wrote this function to retrieve the homepage of the website link recorded in stats based on STRPOS but Medoo is throwing an error.
function getSiteAuthor($string) {
if ($string) {
$result = db::query("SELECT id, http FROM users WHERE (strpos(http, '$string') != false) ");
foreach ($result as $row) {
return $row['id'];
}
}
}
http might be "http://example.com" and $string might be "http://example.com/somePage/". So I am looking for where http is found included in $string
The error is "strpos not found in table".
Can this be done using strpos or should it use LIKE and if so, how to code that.