Everything is a Freaking DNS problem - newbie http://127.0.0.1:8080/blog/taxonomy/term/526/0 en SELECT vs select http://127.0.0.1:8080/blog/node/522 <p>I spent way too much time this weekend trying to get the <a href="http://api.drupal.org/api/file/includes/pager.inc/5" rel="nofollow">pager</a> stuff in Drupal working for a module I`m playing with. </p> <p>I had learned a lot from the watchdog module on how paging was supposed to be working and I was trying to do the same with another database. As I got a page limited by the number of records I wanted but I couldn't find any of the fancy next, previous and page number thingies that I wanted. </p> <p>The watchdog module worked for me and I started stripping the watchdog module till I could actually replace my function with watchdog_overview function. Even replaced the watchdog query with my qeury.. but not such luck.. I couldn't get $output .= <span class="geshifilter"><code class="text geshifilter-text">theme('pager', NULL, 50, 0);</code></span> to work.</p> <p>So as every open source geek does.. I started looking into the code. pager.inc<br /> The header told me the author.. I could mail him and wait or even call him , , but I read on.<br /> <span class="geshifilter"><code class="text geshifilter-text">$pager_total_items[$element] = db_result(db_query($count_query, $args));</code></span><br /> Never returned anything useful.., my mysql log learned me there never was any query with a count ..<br /> Till I modified the pager.inc file to actually perform the query I wanted it to do.. and it started working.<br /> Then I took a closer look at the regexp that was being used to create the $count_qeury<br /> <span class="geshifilter"><code class="text geshifilter-text">$count_query = preg_replace(array('/SELECT.*?FROM /As', '/ORDER BY .*/'), array('SELECT COUNT(*) FROM ', ''),$query);</code></span><br /> However my query was all in lowercase so the count was never inserted.</p> <p>The only difference between the working watchdog module and my own code was in the use of uppercase SQL statements.<br /> So call me lazy :)</p> http://127.0.0.1:8080/blog/node/522#comments drupal mysql newbie pager rtfc stupid Sun, 02 Dec 2007 22:56:45 +0000 Kris Buytaert 522 at http://127.0.0.1:8080/blog Newbie Drupal Experiences http://127.0.0.1:8080/blog/node/463 <p>Every once in a while you start with something new.. you're used to being rather expercienced on different topics in open source , having written an article and a book left or right but there comes a day when you will feel a total newbie again :)</p> <p>About 10 years ago I was mostly into technical webdevelopment , perl, php, oracle plsql , java servlets , coldfusion stuff like that.. I stopped building corporate websites about 7-8 years ago when I realised I was spending more time helping people to build the infrastructure to host those sites than actually building the sites. (That and the fact that I really got bored with people wanting greener green)</p> <p>So fast forward to about 5-6 months ago where I suddenly felth the need again to start writing code for a small pet project of mine.</p> <p>I wanted a framework where I could jumpstart with different features I needed such as usermanagement and a blog feature.</p> <p>As I mentionned earlier this week .. everybody seems to be using Drupal these days and has similar newbie feelings :)</p> <p><a href="http://dag.wieers.com/blog/content/mistakes-made-when-using-drupal-personal-blog" rel="nofollow">Dag </a> is posting about his experiences on how to use Drupal as a personal blog. So my current project is different.</p> <p>For a personal blog I wouldn't be using the blog module either has he describes, but as I wanted different authors .. I understood I do need it.</p> <p>I had the same problem with the Vocabularies and Terms .. Upon starting I really didn't understand what they meant for my blog. So I recreated the categories I had in dotclear in there. I deleted them from my database after a month, when I figured out how to use tagging in the blog :)</p> <p>So what do you need when you want to go one step further, like getting content from a database. So here is where the I probably went totally wrong and where the documentation could use a hand.</p> <p>I started out writing my own module where I use some drupal functions and custom php code. Turns out there is something like CCK but I`m still not sure if CCK is the thing I need (or how to use it)</p> <p>I`m pretty sure the way I`m writing my modules totally wrong also.<br /> I'm having 1 big file in which I do everything.. Pretty crappy if you ask me but I don't really find another way .. Or should I create multiple modules ?</p> <p>Luckily this is <cite>just a hobby, won't be big and professional like</cite>... It's just a project to learn and I got a different dayjob ..<br /> However my fear is that other people probably won't realize how wrong the<br /> are using a certain technology and will offer their services to customers :(</p> <p>So I`m nagging some people about a new Drupal User group meeting.<br /> Guess Dag and I will learn some stuff there ;)</p> http://127.0.0.1:8080/blog/node/463#comments drupal newbie Sun, 07 Oct 2007 09:10:15 +0000 Kris Buytaert 463 at http://127.0.0.1:8080/blog