Search Results

Search found 11 results on 1 pages for 'innatedev'.

Page 1/1 | 1 

  • Sorting MySQL results within a resultset

    - by InnateDev
    I have a resultset of lets say 10 results. 3 of them have a type 'Pears', and the next 3 have a type 'Apples' and the next three have a type of 'Bananas'. The last record has a type of 'Squeezing Equipment' - unrelated to the fruits. How do I return this set of results (for pagination too) in a GROUPED order that I specify WITHOUT using any inherent sort factor like ALPHABETA or ID etc? I have the all types at my disposal before running the code so they can be specified. i.e. ID | Bananas ID | Bananas ID | Bananas ID | Apples ID | Apples ID | Apples ID | Pears ID | Pears ID | Pears ID | Squeezing Equipment

    Read the article

  • How do I optimize this query?

    - by InnateDev
    SELECT DISTINCT wposts.* FROM wp_2_posts wposts, wp_2_postmeta wpostmeta, wp_2_postmeta wpostmeta1, wp_2_term_taxonomy, wp_2_terms, wp_2_term_relationships WHERE wposts.ID = wpostmeta.post_id AND wp_2_terms.term_id = '8' AND wp_2_term_taxonomy.term_id = wp_2_terms.term_id AND wp_2_term_taxonomy.term_taxonomy_id = wp_2_term_relationships.term_taxonomy_id AND wp_2_term_relationships.object_id = wposts.ID AND wpostmeta.meta_key = 'validity' AND wpostmeta.meta_value > '".$logic_date."' AND wpostmeta1.meta_key != 'permanent' AND wposts.post_status = 'publish' AND wposts.post_type = 'post' ORDER BY wposts.post_date DESC

    Read the article

  • How do I remove a validate class using jquery?

    - by InnateDev
    I have some options for pricing using radio buttons. When a user selects the radio button with no value my checkbox form must not be validated. here is my code: Options: <input type="radio" name="pricing_option_rect" id="pricing_imp_rect1" checked="checked" value="100">100 <input type="radio" name="pricing_option_rect" id="pricing_imp_rect2" value="200">200 <input type="radio" name="pricing_option_rect" id="pricing_imp_rect3" value="300">300 <input type="radio" name="pricing_option_rect" id="pricing_imp_rect4" value="0" />0 Checkboxes: <input type="checkbox" value="check1" name="rectcat[]" class="{validate:{required:true, minlength:1, maxlength:5}}" />One <input type="checkbox" value="check2" name="rectcat[]" />Two <input type="checkbox" value="check3" name="rectcat[]" />Three <input type="checkbox" value="check4" name="rectcat[]" />Four <input type="checkbox" value="check5" name="rectcat[]" />Five <input type="checkbox" value="check6" name="rectcat[]" />Six <input type="checkbox" value="check7" name="rectcat[]" />Seven <input type="checkbox" value="check8" name="rectcat[]" />Eight <div class="container"><label for="rectcat[]" class="error">Please Select a Minimum of ONE and a Maximum of FIVE categories!</label></div>

    Read the article

  • treat mysql longtext as integer in query

    - by InnateDev
    I have a set field in my db that is longtext. I have used prices in this field and cannot change the field type to integer. In my query however I need to sort by these fields and assume I should treat them as an integer. is there another way to query these results to sort by price as an integer and not longtext without having to change the field type? at the moment 3900000 is smaller than 4300 in my result set.

    Read the article

  • Wordpress Custom Query

    - by InnateDev
    I have posts that use a custom field for start date and end date. Query_posts returns an array of posts that exist in the category I'm filtering. How do I query posts using this custom field that has date i.e. 03/11/2010 and not the full array. Pagination works on the full array so it returns all posts. I can use an if else to only show the posts newer that today, then pagination doesn't work. Would I have to build a custom mysql query?

    Read the article

  • wordpress mu image speed problem

    - by InnateDev
    I have an mu install with the typical blogs.dir folder storing files for each blog. When loading these images however they take forever to appear, but they eventually do. It seems that wpmu uses php to serve each image which is ludicrous. When using images from the same domain but in a root folder, the images are displayed quickly. Is there a workaround the blogs.php for rendering files? Could there be something else wrong in the settings of my install?

    Read the article

  • ampersand problem with wordpress categories

    - by InnateDev
    I have an array of categories, some with an & i.e. events & entertainment. My script imports these categories and gets the ID of each using its name. i.e.: $cat_id = array(get_cat_id($linearray[0]),get_cat_id($linearray[1]),get_cat_id($linearray[2]),get_cat_id($linearray[3])); My script then adds a post to wp using these category ID's. My problem is that categories from my import with the & are not imported. These same categories (when an email notice is sent) break the email at the &. Is there a simple workaround to this?

    Read the article

  • wordpress query custom fields and category

    - by InnateDev
    I have a query that creates a table view and then another that queries the view. The results are extremely slow. Here is the code: create or replace view $view_table_name as select * from wp_2_postmeta where post_id IN ( select ID FROM wp_2_posts wposts LEFT JOIN wp_2_term_relationships ON (wposts.ID = wp_2_term_relationships.object_id) LEFT JOIN wp_2_term_taxonomy ON (wp_2_term_relationships.term_taxonomy_id = wp_2_term_taxonomy.term_taxonomy_id) WHERE wp_2_term_taxonomy.taxonomy = 'category' AND wp_2_term_taxonomy.parent = $cat || wp_2_term_taxonomy.term_id = $cat AND wposts.post_status = 'publish' AND wposts.post_type = 'post') The $values have been put it in for this example that queries the view table for the results. select distinct(ID) from $view_table_name wposts LEFT JOIN wp_2_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id WHERE post_status = 'publish' AND ID NOT IN (SELECT post_id FROM wp_2_postmeta WHERE meta_key = '$var' && meta_value = '$value1') AND ID NOT IN (SELECT post_id FROM wp_2_postmeta WHERE meta_key = '$var' && meta_value = '$value2') AND ID NOT IN (SELECT post_id FROM wp_2_postmeta WHERE meta_key = '$var' && meta_value = '$value3') AND postmeta.meta_key = 'pd_form' ORDER BY CASE wpostmeta.meta_value WHEN '$value5' THEN 1 WHEN '$value6' THEN 2 WHEN '$value7' THEN 3 WHEN '$value8' THEN 4 WHEN '$value9' THEN 5 THEN '$value10' THEN 6 WHEN '$value11' THEN 7 WHEN '$value11' THEN 8 END

    Read the article

1