Rafael, I'm using your library but apparently I cannot create a query sorting the data (ORDER BY) which it seems it is supported by supabase. How can I do it? (Thanks for the excelent work mate!)
@rafaelpinheiro
2 жыл бұрын
Hello I am aFrog. The library "PHPSupaBase" doesn't have a method to sort the result of a query. But it is possible to do this manually using the code below. ---------------------------------------------------- require "vendor/autoload.php"; $service = new PHPSupabase\Service( "YOUR_API_KEY", "aaabbbcccdddeee.supabase.co/rest/v1/" ); $uri = $service->getUriBase(); $uri .= 'products?select=id,productname,price&order=price'; //ORDER BY "price" $options = [ 'headers' => $service->getHeaders() ]; try{ $listProducts = $service->executeHttpRequest('GET', $uri, $options); foreach ($listProducts as $product){ echo $product->id . ' - ' . $product->productname . '($' . $product->price . ') '; } } catch(Exception $e){ echo $e->getMessage(); } ---------------------------------------------------------- Hope it helps you!
@SoraAmm
2 жыл бұрын
Can you please add english subtitles? Your video is the only source for supabase + PHP across the web so adding English subtitles will be highly appreciated. Thank you
@rafaelpinheiro
2 жыл бұрын
Hey DevMushref, I developed a library that helps development using php and supabase. The documentation is available in English. I hope you enjoy. github.com/rafaelwendel/phpsupabase
Пікірлер: 8