i have a 5 stars rating system, on javascript!!! bau i want to update mysql table, when clicking on stars!!! can somebody tell me how can i update the table!!!
thanks. . .
I've a model called broadcastinfo, It has fields viz.. info,userid...userid is excluded. when i add an new info, my broadcastinfo table should get the records of all userid from user table and the given message. Im trying this via signal.Any idea is highly appreciated.
Thanks
Pages with tables creating problem in print? First page coming blank and content comes in print from 2nd page.
and if table is long i want to print table heading on each print page also.
I have an Employee table, it's a self-referencing table, with managerId refers to primary key empID. I want to find 2 level records by a given empId. For example: if given empId=5,
if empId=5 has children records, display them, as well as the children in children records.
You may also provide a recursive suggestion without level limitation. The database is SQL Server 2005.
ID
NAME
AMT
1
Name1
1000
2
Name2
500
3
Name3
3000
4
Name1
5000
5
Name2
2000
6
Name1
3000
consider above table as sample.
am having a problem in my sql query, Am using like this.
Select name,amt from sample where amt between 1000 and 5000
it returns all the values in the table between 1000 and 5000, instead
I want to get maximum amount record for each name
i.e.,
3 name3 3000
4 name1 5000
5 name2 2000
Hi,
Is this possible, can a trigger in mysql can do a select first and then based on its result do a delete?, both on the same table.
Am struggling to get it right.
There are duplicate entries in a table, i need to have a trigger which selects and then deletes.
Any ideas or thoughts will be really helpful.
Hello, I have a table with OWN_ID and OWN_Email -
3ace7cf80edd | [email protected]
3acf6af33ff7 | [email protected]
3acda2524e00 | [email protected]
3ad75583c9a7 | [email protected]
3ad74b018999 | [email protected]
etc.
the problem is that it should contain only a single ID per Email, also I need to replace all OWN_ID values in another table by highest OWN_ID value of the OWN_Email
Im having a table in which im creating a label dynamically.
'<td>' + '<label for="Name" id = ' + value + '>' + text + '</label></td>'
I want to retrieve the id of the label and I`m doing the following which is not working:
How can I get the Id of the label?
function ReadNames() {
$('#Table tr').each(function() {
NameID.push($(this).find('label').val());
}); }
I have four tables
TableA:
id1
id2
id3
value
TableB:
id1
desc
TableC:
id2
desc
TableD:
id3
desc
What I need to do is to check if all combinations of id1 id2 id3 from table B C and D exist in the TableA. In other words, table A should contain all possible combinations of id1 id2 and id3 which are stored in the other three tables.
Yes it's Windows sorry.
I'm using mysqldump with the option -T which creates a sql and a txt file per table.
mysqldump -u user -ppass db -T path
I use that option to be able to restore easily one table.
Now I'd like to restore all the tables.
mysql -u user -ppass db < path/*.sql
Obvously doesn't work
Also, I don't know where do my funcs/procs go.
Thx
I am using the DataTables plugin for jQuery and need to get one of the table rows. DataTables has a fnGetNodes function that returns an Array with all of the DOMElements of the table. I would like to use a jQuery selector to find that row (I know the id of the row), but I need to convert the Array to a jQuery Object, is this possible?
In mysql I am able to do this:
SELECT *
FROM table
WHERE auth_user.lastactivity > NOW() - 100
now in postgresql I am using this query:
SELECT *
FROM table
WHERE auth_user.lastactivity > CURRENT_TIMESTAMP - 100
but I get this error:
operator does not exist: timestamp with time zone - integer
How can I resolve ?
You can locate the place by searching test11" " " " " " " " in the page,
but if you view the source code, you'll see the related html is like this:
test11<table style="display: table;" class="listview rowstyle-rowhighlight"" id="resourcegrid">
Where does the " " " " " " " " come from?
The problem can be seen here
(rest_branches) is the table of restaurants.
(phone_numbers) is another table which contains the restaurants phone_numbers, and it has a field called (branch_id) which references the restaurant id.
When I try:
SELECT *
FROM rest_branches
NATURAL JOIN phone_numbers
I only get the restaurants which have a phone_number.
What should I do to get all restaurants even if they don't have a phone number?
main_product table
productid outward shopid
333 2 44//present
343 4 44//present
353 5 44//present
363 1 44//present
373 2 44//not present
min_product table
productid outward shopid
333 1 44
343 1 44
353 1 44
363 1 44
SELECT DISTINCT (A.productid),A.outward, B.productid,B.outward FROM main_product A INNER JOIN min_product B on B.productid=A.product_id where A.shopid='44' and B.shopid='44'
my question how can i INSERT OR UPDATE in one query using mysql by checking if it is present or not
if present update else insert
something like this?
INSERT
INTO mytable (key, value)
VALUES ($newkey, $newvalue)
ON DUPLICATE KEY UPDATE
SET value = $newvalue
This is what I'm doing right now:
Execute a query and check if the date
to be inserted already exists in a
table.
If date doesn't exist:
Another query will insert the date into the table.
How can these two query be combined?
I get the following error in the query below:
#1064 - 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 ')))' at line 1
Code Snippet:
INSERT INTO test_bans( ip, Expiration )
VALUES (
"0.0.0.0", DateAdd(
"d", 1, Date( )
)
)
Table creation query
CREATE TABLE test_bans (
ID smallint(6) NOT NULL AUTO_INCREMENT,
IP text NOT NULL,
Expiration DATETIME NOT NULL,
PRIMARY KEY (ID)
) TYPE=MyISAM;
What am I missing?
Hi i would like to add some function to my app. How it is possible to get data from web page.
For example i login to webchat which is ofc https secure. And now there is some table with user replies.
How it is possible to get the table or some other html component, data to my C++ program.
Its SSLed, so we dont want to sniff http.
What should i do?
Hi guys:
Suppose we got a original query as follows:
SELECT A, B, C FROM tblA
Now, I need to additional artificial rows like
SELECT 'Kyala', B, C FROM tblA when, for example, C = 100 to be inserted into the resultset.
How could I achieve it using a single SQL instead of relying on table variable or temp table?
Hi guys, I've got this table
CREATE TABLE `subevents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(150) DEFAULT NULL,
`content` text,
`class` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM
Each row can have a different value in the 'class' field.
I'd like to select any number of rows, ordered randomly, as long as the sum of the values in the 'class' field is equal to 100.
How could I accomplish it directly in the MySQL query without doing it later in PHP?
Thanks everybody!
Say that I have a table with one column named CustomerId.
The example of the instance of this table is :
CustomerId
14
12
11
204
14
204
I want to write a query that counts the number of occurences of customer IDs.
At the end, I would like to have a result like this :
CustomerId NumberOfOccurences
14 2
12 1
11 1
204 2
14 1
I cannot think of a way to do this.
Say I have a 'user_log' table with the following field:
id
user_id
status_text
timestamp
How do I write a query that selects only the last update for all the users in that table?
Appreciate your help :)
This time my setup looks like this: one table with galleries names (gallery_id, gallery_name) and another table with galleries photos (photo_id, photo_gallery_id, photo_name).
What I need is to get all the galleries with one random picture for each gallery.
Is it possible to do this with a single query?
hi,
Am working with sybase.In that i have a table A of some 2 million records containing some columns which i want to move out and make it as a separate table B. I have some questions in this process...
1. I have decided to use vertical partitioning.Is that ok?
2.Or what other technique can i go about using in this process?
Please provide your valuable inputs in this.
Thanks.