I was looking online for a script that demonstrates how I would go about making it possible for users on my site able to edit fields and such, but I could not find anything about it. So I was wondering if someone could explain to me how it works or just demonstrate with a script? To make it clear, I want users to be able to edit stuff th...
Is it possible to check how many rows were deleted by a query?
queryset = MyModel.object.filter(foo=bar)
queryset.delete()
deleted = ...
Or should I use transactions for that?
@transaction.commit_on_success
def delete_some_rows():
queryset = MyModel.object.filter(foo=bar)
deleted = queryset.count()
queryset.delete()
PHP...
I have a product table like this:
Product name , Affiliate ID , ProductCode
a, 1, 1
b, 1, 2
c, 1, 3
d, 1, 5
e, 1, 7
f, 2, 4
g, 2, 6
I want to return first four products from each Affiliate ID. The 'ProductCode' column signifies the order in which the products were added, so can I use this column to sort my results. But I don't know ho...
We're building a small-sized GIS Web application (as a school project) right now.
In terms of spatial database support and capabilities, which is better?
:)
thanks everyone!
...
I have inherited a site that includes a bespoke CMS. I moved hosts and after the move, I now get this error when trying to update pages;
Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Park Baptist Church
So, the application is failin...
Hello. I have the following yml configuration for Doctrine under MySQL:
Designer:
tableName: designers
columns:
id:
type: integer(2)
name:
type: string(30)
notnull: true
Item:
tableName: items
columns:
id:
type: integer(3)
unsigned: true
primary: true
autoincrement: true
...
What are views in MySQL? What's the point of views and how often are they used in the real world.
I'm after a layman explanation please with a example if possible to aid my understanding!
Thank you in advance ;-)
...
I currently have the following:
Table Town:
id
name
region
Table Supplier:
id
name
town_id
The below query returns the number of suppliers for each town:
SELECT t.id, t.name, count(s.id) as NumSupplier
FROM Town t
INNER JOIN Suppliers s ON s.town_id = t.id
GROUP BY t.id, t.name
I now wish to introduce another table in to th...
Hi,
I have installed php5.3.2 and MySql on Ubuntu 10.4.
Now how do I add or download php_mysql.dll to add mysql support in php ?
I have visited MySql Download page, but I don't know what to download.
Can someone point me in a right direction ?
I am not sure, if this question might fit in Superuser.
Thanks.
...
In the code below there is a hash which contains records with fields like name, pid, type and time1.
pid and name are repetitive fields which contain duplicates.
I duplicate found update the fields which need modification
else insert, here name and pid have duplicates (repetitive fields).
The rest are unique. Also I have a unique field...
if i write delete * from tablename in mysql ,all rows get delete it there any way to get the data back in mysql in that table
...
How to Cache RAND() random images in PHP MYSQL
use to be cache for 5 seconds then on refresh its change images
reply
...
I have two rating/votes tables. One for user votes and stats and another for external votes.
The external votes table always have data because it has a DEAFULT = 0, but the users votes only contains data if any user have voted for that specific ID.
So I do something like this:
$sql = 'SELECT ratings_stats.votes, ratings_stats.tota...
How to connect to MySQl db on linux server using toad?
what i should give on host?
i get the error
Can't connect to MySQL server on 'tinywall' (10061)
...
i am using MySQL with PHP & Doctrine 2.
my question is assuming i am using Modified Preorder Tree Traversal is there a way i can retrieve only immediate children?
...
I'am not sure that while problem, but take a look:
I have 3 tables:
Categories: id, icon, name;
Subcategories: id, name, description, category_id;
Topics: id, title, text, author, created, subcategory_id;
Now I'm trying get this info(query):
$String = "SELECT
categories.id AS catid,
categories.icon AS caticon,
categories.na...
I have a randomly generated link id which is 8 digits long with 50 values per digit, which means 4x10^13 possible combinations (i think). I have about ten-thousands of queries per day.
My question is, should I check 4 tables each query for duplicates, or skip it? or make it 10 digits so that it definitely won't be a match?
edit:
my (p...
I have a table similar to the following (of course with more rows and fields):
category_id | client_id | date | step
1 1 2009-12-15 first_step
1 1 2010-02-03 last_step
1 2 2009-04-05 first_step
1 2 2009-08-07 last_step
2 ...
I try to SUM values from columns, from a query which contains some JOINS.
Example:
SELECT
p.id AS product_id,
SUM(out_details.out_details_quantity) AS stock_bought_last_month,
SUM(order_details.order_quantity) AS stock_already_commanded
FROM product AS p
INNER JOIN out_details ON out_details.product_id=p.id
INNER JOIN or...
From the little that I know about WCF it seems to be the right solution to a particular problem I have but I'd like to get some input on it.
Problem Description:
Clients sequentially access domain objects from a list roughly once ever 1-10 minutes (average is 2 mins), but no 2 clients should ever access the same object. Certain orderin...