Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged query



« Prev 1 2
  1. FAV

    How to use "IN" Query in Laravel ?

    In Laravel you can use "IN" query as Using Eloquent $data = YourModel::whereIn('id', array(1, 2, 3))->get(); Using DB Query builder $data = DB::table('your_table')->whereIn('id', array(1, 2, 3))->get();
    PHP 130 views posted 5 months ago by interviewqueries
  2. FAV

    Get Whois Information.

    If you need to get the whois information for a specific domain, why not using PHP to do it? The following function take a domain name as a parameter, and then display the whois info related to the domain.
    PHP saved by 2 people 13 views posted 7 years ago by o0110o
  3. FAV

    Query posts and cache the query

    Snippet to show a simple use of the transient API when querying posts.
    PHP 9 views posted 7 years ago by Mat_
  4. FAV

    Prevent sql injection in LIKE queries

    Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
    PHP 19 views posted 7 years ago by TimoZachi
  5. FAV

    Uri multiple parameters

    This function allow you ti have multiple parameters in your query string. Ex : id=12&name=Doe&id=42&nickname=Monster
    PHP 8 views posted 7 years ago by MonsterDev
  6. FAV

    MySQL INSERT Query Generator w/ Strings

    Takes your table name and key=>value array of values and returns the text for inserting into a MySQL database. Automatically surrounds strings with single quotes.
    PHP saved by 3 people 14 views posted 7 years ago by lemcoe9
  7. FAV

    db2 connect and query

    Connect to and query a db2 database using php.
    PHP 16 views posted 7 years ago by zombree
  8. FAV

    Run MySQL query

    PHP saved by 5 people 17 views posted 7 years ago by paul0078
  9. FAV

    pagiantion from one query

    PHP 3 views posted 8 years ago by atul
  10. FAV

    Wordpress Query Posts

    PHP 4 views posted 8 years ago by ronal
  11. FAV

    Wordpress query term taxonomy

    PHP 4 views posted 8 years ago by pmalerba
  12. FAV

    Query any Post Type anywhere

    Query any Post Type anywhere
    PHP 4 views posted 8 years ago by zealmurapa
  13. FAV

    Custom WP_Query pagination issues

    PHP 2 views posted 9 years ago by joshvermaire
  14. FAV

    Basic Query Post

    PHP 4 views posted 9 years ago by rliverman
  15. FAV

    Magento insert query

    run mysql query direct on your magento script
    PHP 3 views posted 9 years ago by aashvi
  16. FAV

    Query the database PHP

    To use: $update_sql = querys($sql); or $select_sql = getresult($sql); Used simplify selecting rows from a database. You'll need to pass in the SQL statement.
    PHP 3 views posted 9 years ago by shawntysco
  17. FAV

    Custom filtering and sorting for events via functions.php

    Uses action hook of the hybrid theme framework to launch function that modifies the query on the archive page for category 6.\\r\\n\\r\\nSorts by the custom field \\\"event_date\\\" and compares it to the current date.\\r\\n\\r\\nBased on [goto11\\\'...
    PHP 3 views posted 9 years ago by hussong
  18. FAV

    Wordpress query analizer

    PHP 3 views posted 9 years ago by neverdark
  19. FAV

    Wordpress: Get sticky posts

    PHP saved by 2 people 4 views posted 9 years ago by S_Park
  20. FAV

    Wordpress: Reset paging after query_posts

    After querying posts the paging (Next/Previous) may not work. Use this to restore.
    PHP saved by 2 people 3 views posted 9 years ago by S_Park
  21. FAV

    Generate URL-encoded query string

    PHP 6 views posted 9 years ago by adampatterson
  22. FAV

    WordPress paginated wp_query

    PHP saved by 3 people 5 views posted 9 years ago by vagrantradio
  23. FAV

    Fetch $_GET array as a string representation

    PHP 4 views posted 9 years ago by andyhartleeds
  24. FAV

    Wordpress pagination on a query

    PHP 4 views posted 9 years ago by Ben
  25. FAV

    Query to get posts by category - Wordpress

    PHP 4 views posted 10 years ago by errkk
  26. FAV

    WordPress retrieve custom field from outside the loop

    PHP saved by 3 people 5 views posted 10 years ago by davebowker
  27. FAV

    Wordpress Query Numbers & Timer

    PHP 3 views posted 10 years ago by fatihturan
  28. FAV

    hook_views_query_alter drupal 6.x

    PHP saved by 2 people 4 views posted 10 years ago by ReeceMarsland
  29. FAV

    mysql_safe_query to prevent SQL injection

    PHP saved by 9 people 15 views posted 10 years ago by jmiller
  30. FAV

    Wordpress, reset a query

    PHP 6 views posted 10 years ago by gfazioli
« Prev 1 2