Hi,
I have two tables like of this structure
content (content_id, content_type, user_id, time, comment_count)
comments (comment_id, content_id, userid, comment, comment_time)
What I wold like to do is update the comments_count field with sum of comments i.e COUNT(content_id) from the comments table.
I am not able to figure out the r...
When I run cap deploy:update in a directory on my local machine (via cygwin), "C:" magically appears in the directory. Sure enough, I can cd to it and it's my windows C: drive. Now I'm afraid to delete it, but I definitely don't want it in this directory (a rails project under /home/username/blah/blah).
Here's my config/deploy.rb file. ...
I need to run a PHP loop for a total of 100, 000 times (about 10, 000 each script-run), and each loop has about 5 MySQL UPDATES to it. When I run the loop 50 times, it takes 3 sec. When I run the loop 1000 times, it takes about 1300 sec. As you can see, MySQL is slowing down ALOT with more UPDATEs.
This is an example update:
mysql_quer...
I'm have a problem with an invite system. The if statement seems to break. It shows the message "Fail" but the UPDATE statement still executes. Why do both the THEN and the ELSE excute?
$dbConn = new dbConn();
// Check if POST user_username and user_hash are matching and valid; both are hidden for fields
$sql = "SELECT user_username "
...
Hi,
I installed the sml interpreter from here : http://www.smlnj.org/, I used the self extracting .EXE for windows. (I'm running windows7 64 bit)
Although simple operations on basic datatypes are working, it is not recognising operations on arrays/vectors (update, array constructor etc). Do i need to install something else as well to ma...
Hi,
I have a server where I installed SQL Server 2008 and after I applied the SP1.
Now, I want also to add the Analysis Services to this instance by using the "Add or remove features...".
My questions are:
Is it possible to add the Analysis Services on a server with SP1 already installed?
How can I apply the SP1 also to the new Anal...
What I want to do is implement submission scoring for a site with users voting on the content, much like in e.g. reddit (see the 'hot' function in http://code.reddit.com/browser/sql/functions.sql). Edit: Ultimately I want to be able to retrieve an arbitrarily filtered list of arbitrary length of submissions ranked according to their sc...
Hi everyone!
I have a ModalPopUpExtender with an UpdatePanel on it. On the UpdatePanel,there few labels and componentart Grid which Updates from the server on every Asynchronous postback when an image button is clicked.
The Problem is that the server code updates the modalpopupextender labels as the information on the grid but it wont d...
Hi,
I just edited an .SWF file I have on my website home page for a while now. I update the SWF frequently with new pictures. It's actually a picture slideshow, consisting out of 6 images. I used Adobe Flash CS4 Pro to edit the file, with just swapping all the pictures (JPGS) in it for other ones. I also have some small AS where I just h...
I have two tables, tableA and tableB, linked through a locationID.
TableA has descriptive survey info with each record from a different time (ie unique), while TableB has purely locational information. However, there are lots of duplicates in TableB, yet each has a unique locationID, which has an entry in TableA. I've found plenty post...
How could I simplify this update instruction? Whenever a client buys an item it will update the sales with 1.
$this->db->query('SELECT amount FROM shop_items WHERE itemid='.$itemid.'');
$new_amount = $item->amount+1;
if(!$this->db->query('UPDATE shop_items SET amount='.$new_amount.' WHERE itemid='.$itemid.'')):
return false;
...
update p
set p.storePrice =
CASE
WHEN p.costPrice BETWEEN 0.00 AND 1.00
THEN p.costPrice * 1.0
CASE
WHEN p.costPrice BETWEEN 0.00 AND 1.00
THEN p.costPrice * 1.0
ELSE
p.msrpPrice
END
FROM product p
WHERE p.type = 1
The error says:
Msg 156, Level 15, State 1...
Query to Where X update Y and where A update B in a Mysql Table column.
How can I Do this in MYsql in one querry on the same column in a specific table.
I want to search and replace multiple values in a table column.
Conditons in table1 in column1
Where X update Y
and
Where a update b
and
Where 1 update 2
and
Where 3 update 4
and
Whe...
Hi, I'm having problems updating a div's content in IE using .update; I also tried with innerHTML with no success. My script works fine with firefox and chrome, but I need to make it work with IE too (neither 7 nor 8 accept the functions). Any hints ?
Thanks in advance.
The context is a simple shopping cart with two spinner buttons to m...
Hi everyone,
First some background information;
I've set up my SVN repository on my local server at home using VisualSVN Server.
Using SSH on (or via php/shell script), i am able to check out a folder from this repository to the webserver, all goes well.
Also updates and other svn commands execute normaly and return their messages.
...
Hi,
I am working on a java based application and we are looking to ease our deployment of updates. Up until now, we've always simply sent out new install packs & had the sysadmin's on our customer sites roll out the upgrades - painful for a large number of users.
what I'd like to do is something similar to java webstart (or eclipse p2...
I have got a table which contains 5 column and query requirements:
update row no 8 (or id=8) set its column 2, column 3's value
from id 9th column 2, column 3 value.
means all value of column 2, 3 should be shifted to column 2, 3 of upper row (start from row no 8) and value of last row's 2, 3 will be null
For example, wit...
I'm writing an updater program in Delphi7 which will be run once, but needs many files to run.
What I'd like the achieve:
User runs exe
Exe unpacks files, runs updater
If updater detects and error, prompts the user to send log in e-mail
After the updater is run, temporary files are deleted (some of these files are dlls used by the upd...
I have a table that stores a value that will be added to over time. When I want to add to the value I would like to do so in a single query rather than -
Get oldValue from database
newValue = oldValue + X
update row with newValue
$query1 = "SELECT value FROM table WHERE id = thisID";
$result1 = mysql_query($query1);
while($row=mysql_f...
I am trying to use an update query to change values held in a database, the new values I am trying to store are held in php variables. I'm not sure what it is I'm doing wrong.
mysql_query("UPDATE user SET
status='full' WHERE user_id =
'$user_id'")or die(mysql_error());
here is the error message
Duplicate entry '91317691' fo...