update

can't install PHPUnit through pear

the install instructions for phpunit are running this: pear channel-discover pear.phpunit.de pear install phpunit/PHPUnit the first one goes okay , on the second I get an error: phpunit/PHPUnit requires PEAR Installer (version >= 1.8.1), installed version is 1.7.2 phpunit/PHPUnit can optionally use package "pear/Image_GraphViz" (vers...

Update cached data in a hashtable

In order to minimize the number of database queries I need some sort of cache to store pairs of data. My approach now is a hashtable (with Strings as keys, Integers as value). But I want to be able to detect updates in the database and replace the values in my "cache". What I'm looking for is something that makes my stored pairs invalid ...

SPROC to update record: how to handle unchanged values

I'm calling a update SPROC from my DAL, passing in all(!) fields of the table as parameters. For the biggest table this is a total of 78. I pass all these parameters, even if maybe just one value changed. This seems rather inefficent to me and I wondered, how to do it better. I could define all parameters as optional, and only pass t...

Adding update SQL queries

I have a script that updates itself every week. I've got a warning from my hosting that I've been overloading the server with the script. The problem, I've gathered is that I use too many UPDATE queries (one for each of my 8000+ users). It's bad coding, I know. So now I need to lump all the data into one SQL query and update it all at o...

How to set and enable new php content by date in php?

I would like to set 5 new content items for monday through friday, but don't want to have to enable them each day. Would it be best to set a timestamp in a mysql field, then something like this. Set up a crontab with php that runs if timestamp is equal to today set "on" to 1. What date/time format would be best, also if I put dates 0...

DataGrid using SQLDataAdapter Update Problem

I have a nice litte DataGridView, which gets loaded/populated by a button and a SQLDataAdapter and the corresponding saveButton. private void loadButton_Click(object sender, EventArgs e) { String connString = conStringComboBox.Text; String query = queryStringComboBox.Text; dAdapter = new SqlDataAdapter(query, connString); ...

WPF Instantiate User control programmatically to render it as PNG

hey all, I want to instantiate a user control programmatically in a DLL to save it afterwards as PNG file. This is generally no problem with PngBitmapEncoder and RenderTargetBitmap. This are my questions: How do I instantiate the control? Simply with the new-operator? Do I have to instantiate it in an seperate thread? How do I force ...

Having trouble doing an Update with a Linq to Sql object

Hi folks, i've got a simple linq to sql object. I grab it from the database and change a field then save. No rows have been updated. :( When I check the full Sql code that is sent over the wire, I notice that it does an update to the row, not via the primary key but on all the fields via the where clause. Is this normal? I would have ...

WordPress Post Date Changes On Update

Hi all, I have my permalinks in WordPress set to the Month and Name setting. This generates URLs like /blog/2009/09/my-post-name. Every time a post is updated, it changes the posting date, which can potentially change the permalink address. This is wreaking some havoc on my site, as I'll have banner/button ads throughout that point to ...

How does stack overflow mirror what you're typing?

Right now while I'm typing this theres the preview down below the editor. I would like to do something similair and am wondering how Stack Overflow does this? Thanks! ...

Why is there extra space being added whenever I execute PHP code that updates any text field in a MYSQL database?

Hello, I am building a blog site and am having trouble with updating fields in my MYSQL database. Whenever I hit the update button on the form that uses PHP, it adds extra space before the text string in the MYSQL text field. Here is the PHP code: //UPDATE TEXT $updated_text = $_POST['text'.$the_post['ID'][$n]]; if ($updated_t...

Sql Server 2008 - How can I select all rows and update a field with its hash code?

Hi everyone! In my project, I'm in a point that is lack of knowledge of sql programming. I have a tbUsers with a passowrd field. But, now I have to trasnform them to hash MD5, so far so good for the hash. But, how can I select all passwords recorded and update them with its hashvalue? I don't really need the hashvalue part, just the se...

iphone downloading data from a database and then checking if the database has been updated

So I have an iphone app that downloads data from a shared database. It switches between views and when it returns to the "data" view I'd like to download only the new data in the database. What is the best way to achieve this? ...

WPF shrinking child panel.

Hi, I'm working on a UI for a WPF application. I have in my window Stack Panel with some Expanders inside. In each Expander are some controls, one being a List Box. What I want to do is have the List Box resize (shrink or grow) when the window is resized. At the moment, when I re-size, the expander are getting clipped off but the listbo...

MySQL: Update all Columns With Values From A Separate Table

Sometimes if I want to quickly copy records from one table to another (that has the same structure) I use a query like this: INSERT INTO table2 SELECT * FROM table1 WHERE id = SOME_VALUE How can I add a ON DUPLICATE KEY UPDATE to this statement? I tried this: INSERT INTO SELECT * FROM table1 WHERE id = 1 ON DUPLICATE KEY UP...

How to update DB structure when updating production system without doing a teardown / rebuild

If I'm working on a development server and have updates to the database structure for some of our releases, what is the best way to update the structure on the production server? Currently we create a new production database containing the structure only, do a SQL dump of the data on the 'old' production database, then run a SQL query t...

jQuery .load and links are not clickable anymore?

Hi. I'm updating some data from sidebar when I click one element on mainside. When it's updating data from external file (calling same query what is in original sidebar) those links are not clickable any. Here is clip from my custom.js $(function() { $(".removeItem").click(function() { var commentContainer = $(this).parent(); ...

Problem with updating entity relation using stub entities

EDIT: Stub Entities Definition I have two entity types Subscriber and AddOn Their definition in data model is as below Subscriber(#SubscriberID,Name,AddOnID) AddOn(#AddOnID,Name) AddOnID column in the Subscriber table references the AddOnID column in AddOn table. I'm trying to update the AddOn reference of a specific Subscriber ...

update multiple rows using limit in mysql?

UPDATE messages set test_read =1 WHERE userid='xyz' ORDER BY date_added DESC LIMIT 5, 5 ; I am trying to use this query to update a set of 5 rows using limit but mysql is showing an error..The one below is working UPDATE messages set test_read =1 WHERE userid='xyz' ORDER BY date_ad...

SQL UPDATE - IS there a more elegant and efficient way of doing this?

I have 3 tables Site, Price and PriceMonth. Site has many Prices (joined on siteId). PriceMonth holds a date which is a looked up by Price (joined on PriceMonth). The idea is that the price records are created when a site is created as place holders. When a user clicks a Price row in a view - I need to update the prices for the res...