Jump to content

lordvader

Members
  • Posts

    56
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lordvader's Achievements

Member

Member (2/5)

0

Reputation

  1. Let's say my table has lots of columns, and every 5th column is an index. Then let's say I need results from severl indexes, and also from column #2 (which is not an index). Is it better to group all the indexes at teh front of my WHERE, or should I just go in order of the table's columns? To illustrate: WHERE index_column_1 = whatever AND index_column_5 = whatever AND index_column_10 = whatever AND column_2 = whatever versus: WHERE index_column_1 = whatever AND column_2 = whatever AND index_column_5 = whatever AND index_column_10 = whatever Thanks
  2. I'm exploring inner joins. This guy's wordpress plugin code has an inner join like this: FROM (((($wpdb->posts INNER JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id)) So I'm wondering if that's the same as: FROM $wpdb->posts INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) INNER JOIN $wpdb->terms ON ($wpdb->term_taxonomy.term_id = $wpdb->terms.term_id) thx
  3. That's really close - however the formatting shows up along with the text - stuff like line breaks, new paragraph symbol, etc. Is there a way to do this while allowing the html to render? Thanks
  4. Sometimes a blog post's comment will be too long. I want to enforce a maximum character limit, and if the comment exceeds this then it is presented with a slider so you can still read the whole comment, but the comment won't take up too much space. You know, like how your browser deals with long webpages. I don't think iframes are suitable here, so how could I do this? I don't need specifics, just the general concept and proper buzzwords. I can look it up myself. Thanks On re-reading this, I realize this is not necessarily a php question (although my site is written in php). Sorry about that.
  5. So why bother? Why not just SELECT * FROM TABLE?
  6. Sometimes in practice I see SELECT * FROM TABLE WHERE 1=1 What's that 1=1 for? thx
  7. When getting a count of all entries that fulfill whatever criteria, which is faster: select count(*) or select count(column_name_that_is_a_primary_index) Thanks
  8. What does it mean when an example has %s and they say the %s is a string placeholder? Is that an actual php function or are they just using some kind of literary shorthand? If it is a php thing, how do I use it? thanks
  9. I want to add a column to an existing table, but first I have to check if the column exists. I can think of several ways to check: CASE WHEN EXISTS SHOW COLUMNS mysql_list_fields mysql_num_fields mysql_field_name But I was wondering in your experience, what is the simplest most efficient way to check if a column exists, if not, then add it to the table? thanks
  10. My concern is whether or not there is a setting that will halt all rendering and output a mysql error message to the visitor. Because if that's a possiblity, then I'll have to include the code to manually limit the counter from incrementing if it's at 255 already.
  11. When learning creating tables, I see stuff like INT(11)... what's that paranthesis'd number do? I looked it up on mysql's site but I don't understand: That last sentence especially is what I don't understand. Could someone show some examples? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.