Posts

mysql - A multitude of the same id in an WHERE id IN () statement -

I have a simple query, which increases the value of the field by 1. Now I was looping on all the IDs and the fire seemed to be a query for each of them, but now these things are getting huge resources, I want to customize it. Normally I'll just update table SET field = field + 1 WHERE id (all id here) but now I have problems that there is ID That's twice (or more, I can not know on forehand). If the query looks like this, there is a way to run twice for ID4: UPDATE table SET field = field + 1 WHERE id IN (1, 2, 3, 4, 4) , 5) thanks, lordstyx Edit: Sorry for not being clear enough. ID here is an Auto Ink field, so it's all unique ID. The ID that is to be updated is coming indirectly from users, so I can not predict which ID is going to be made if IDs are (1, 2, 3, 4, 4, 5) I have to increase the line area with ID 4 to 2, and with all the rest 1. if (1, 2, 3, 4, 4, 5) Comes with a SELECT id. query, you can do something like this: Add your table...

html - CSS - vertically centering inside BUTTON element -

I am trying to create a row with the button, where the button inside the button is vertically aligned between the button. All buttons must have the same height The problem occurs when an image is used inside a button I have created a small example: Why is not the third button to combine with the second 2? I think the button should be enough for small content? If I have vertical-align: middle; If you use then

ios4 - Core Data fetch by property count -

I'm just trying to get the object that contains a large number of nsset, then in Core Data 0 something like this Get all the items, which are the object.set & gt; "Text"> I was able to find a way to work: NSPredicate * predicate = [NSPredicate predicateWithFormat: @ "Set. @ Count> 0"]; If there is a better way, please tell me, I am posting here to help anyone with the same problem. Thanks

php - Login system with shopping cart -

For exmaple, we have a site that sells car wheels I am not registered there and the wheel in the shopping cart I add (this is stored in cookie ) After entering, I get this wheel in my account shopping list. What's wrong: What if someone else added another wheel from my computer and I will get it in my shopping list after login. I do not understand how to solve this situation. If you use a cookie to bind a shopping cart to a user, you have a problem Not because cookies are typically specific to a fixed browser on a particular account on a computer.

Get all values in one array PHP -

मेरे पास यह सरणी है: array (3) {[0] = & gt; सरणी (3) {[0] = & gt; सरणी (1) {[0] = & gt; स्ट्रिंग (2) "14"} [1] = & gt; स्ट्रिंग (2) "12" [2] = & gt; स्ट्रिंग (2) "13"} [1] = & gt; स्ट्रिंग (2) "10" [2] = & gt; स्ट्रिंग (2) "11"} वहाँ एक स्ट्रिंग में आउटपुट सभी मानों के साथ कुछ PHP फ़ंक्शन है इस तरह: सरणी (5) {[0] = & gt; स्ट्रिंग (2) "14" [1] = & gt; स्ट्रिंग (2) "12" [2] = & gt; स्ट्रिंग (2) "13" [3] = & gt; स्ट्रिंग (2) "11"} आप उपयोग कर सकते हैं: $ आउटपुट = सरणी (); Array_walk_recursive ($ inputArray, create_function ('$ val, $ key, $ obj', 'array_push ($ obj, $ val);'), और आउटपुट)

java - deleting an object from an array -

There is an array of objects of my custom class and I want to delete a random object (selected by certain criteria). How can I do this and order the array? Naturally, the elements will be transferred on the left side, but it is not enough to remove the element and I need help in preparing the argument. This is what I am doing but it does not work properly for this: ( public static zero deletion record (customer [] record, intexide) {int pos = 0 ; // Indicator Boolean found = false; for (int i = 0; i & lt; count; i ++) {// If there is number of elements in the count (record [i] .get_accountid () == AccId) {Found = true; pos = i; break;}} If (found!) For System.out.println ("record does not exist") (int j = paus + 1; j & lt; count; j + +) {Record [J-1] = Rick [J];} You can only move elements left because This will be overwrite items for deletion. Generate public zeros (object [] A, index index) {for (int i = index + 1; i & lt; a.length Assume that th...

android - writing too many times in a database -

I am trying to store some GPS data in the database which I get from a KML file using DDS , The problem is that every time I run my program, I store this data. This means that I have stored it several times, after which I will have to create a sequence based on this GPS data which is stored in esclaim. The problem now is that I do not have this route correct because there is a mess in my database. I have stored too much data for a lot of time. Does anyone know how I can do this? I am running on Android 2.1 Re-write the data base initialization argument so that it stores an indicator The data base can be started. (The shared context is good for this.) Then test for the indicator and leave the data base initialization on the start-up, if the indicator shows that it has already been done.