[neclimdul@gmail.com: Fwd: [development] LinksDB vs. Links]
Hi all,
* Your SQL queries will not work on PostgreSQL. It needs db_query('word "%s" word') not db_query("word '%s' word").
For the reference of those that don't know yet, the correct way for both MySQL and PostgreSQL is: db_query("word '%s' word"); Strings in ALL database systems must be encased in single quotes. If you do otherwise you're breaking the SQL standard. Cheers, -- Sammy Spets Synerger Pty Ltd http://www.synerger.com/ * You use double spaces after sentences in _report_submit. * Listen, I know I said you shouldn't use drupal_goto a few bullets ago. That doesn't mean you go and use drupal_set_header with a Location: instead. Man alive. * Oh, and you're passing ; at the end of most of your SQL queries. You don't need to do that either. * You use "'<Root>'" in linksdb_deadlinks, and '<Root>' in linksdb_suggest. Which is it? (For what it's worth, it should be '<'. t('root') .'>', per Drupal core). * To prevent things like "select * from {links_links} where dead=1 order by {links_links}.name", use table abbreviations, like: "select * from {links_links} ll where dead=1 order by _l_l_._n_a_m_e". * if(variable_get('linksdb_show_report',1)==1) - you don't need ==1. * linksdb_deadlinks doesn't translate the report messages. * You use "links/report/$link->id" and then 'links/refer/' . $link->id. Which is it? Concatenation or interpolation? * Oooh, you do know how to predeclare $form = array() in _suggest(). I guess you must have made sloppy mistakes all the other times. Story of your life, eh? * "({name},{url},{description},{active},{category})" - I have no clue what you're even attempting there. Column names aren't prefixed. * Is it site staff or site administrators? You use both. * theme_link() - Gah, you don't use theme('image') here. * Is it "Link" or "link"? Previously you have "Report this link", but then you have "Edit Link". * $cat->shown=99999999;. Right. Heh. * You seem to use the "Report this link as dead" thing a lot. That should be made a function. * # for comments? What is this, Perl? And so on. But I'm getting bored. -- Morbus Iff ( drowning in data, bereft of knowledge. ) Technical: _h_t_t_p_:_/_/_w_w_w_._o_r_e_i_l_l_y_n_e_t_._c_o_m_/_p_u_b_/_a_u_/_7_7_9 Culture: _h_t_t_p_:_/_/_w_w_w_._d_i_s_o_b_e_y_._c_o_m_/ and _h_t_t_p_:_/_/_w_w_w_._g_a_m_e_g_r_e_n_e_._c_o_m_/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / _j_a_b_b_e_r_._o_r_g: morbus ----- End forwarded message -----
On 3 Aug 2006, at 07:18, Sammy Spets wrote:
Hi all,
* Your SQL queries will not work on PostgreSQL. It needs db_query('word "%s" word') not db_query("word '%s' word").
For the reference of those that don't know yet, the correct way for both MySQL and PostgreSQL is: db_query("word '%s' word");
Strings in ALL database systems must be encased in single quotes. If you do otherwise you're breaking the SQL standard.
I'll guess I'll be going back and changing it all to what it was then before moby chipped in... ;)
Cheers,
-- Sammy Spets Synerger Pty Ltd http://www.synerger.com/
M Information in this electronic mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this mail by anyone else is unauthorised. If you are not the intended recipient any use, disclosure, copying or distribution of this message is prohibited and may be unlawful. When addressed to our customers, any information contained in this message is subject to intY's Terms & Conditions. Please rely on your own virus scanning and procedures with regard to any attachments to this message. Scanned by MailDefender - managed email security from intY - www.maildefender.net
* Your SQL queries will not work on PostgreSQL. It needs db_query('word "%s" word') not db_query("word '%s' word").
For the reference of those that don't know yet, the correct way for both db_query("word '%s' word"); Strings in ALL database systems must be encased in single quotes. If you do otherwise you're breaking
I'll guess I'll be going back and changing it all to what it was then before moby chipped in...
/me sighs. Sorry about that. I always screw that up. Not a week goes by that I ask about it on the #drupal channel. And morby, not moby. Nobody listens to techno. <g> -- Morbus Iff ( shower your women, i'm coming ) Technical: http://www.oreillynet.com/pub/au/779 Culture: http://www.disobey.com/ and http://www.gamegrene.com/ icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus
On Thursday 03 August 2006 02:18, Sammy Spets wrote:
For the reference of those that don't know yet, the correct way for both MySQL and PostgreSQL is: db_query("word '%s' word");
Strings in ALL database systems must be encased in single quotes. If you do otherwise you're breaking the SQL standard.
I wondered about that when I saw the original post by Morbus Iff. I use single quotes all the time in Postgres with Java programming, but I don't use PG with Drupal or PHP at all, so I just assumed it must be some quirk in the PHP Postgres libs. Thanks for clarifying. My world is at rest again. Syscrusher -- ------------------------------------------------------------------------------- Syscrusher (Scott Courtney) Drupal page: http://drupal.org/user/9184 syscrusher at 4th dot com Home page: http://4th.com/
participants (4)
-
Matthew Jenkins -
Morbus Iff -
Sammy Spets -
Syscrusher