Hi Friends
http://en.wordpress.com/tag/1000-things-we-hate/
http://en.wordpress.com/tag/1019/
http://en.wordpress.com/tag/1030-am/
http://www.yahoo.com/index.html
http://www.msn.com/index.html
i am having list of domains as above in my DB, i need to get only domain name from this, how can i do that in mysql or in JAVA or in PHP ??
...
I have a timestamp column that auto updates on insert/update.
I want to get the rows that have been updated within the last 10 minutes.
SELECT
*
FROM
status
WHERE
code='myCode'
AND
'stamp_updated'
BETWEEN
NOW()
AND
DATE_ADD(NOW() , INTERVAL - 10 MINUTE)
ORDER BY
stamp_updated DESC
LIMIT ...
I have a query that is producing something like this:
StartTimestamp | EndTimestamp
================================
100 | 450
--------------------------------
150 | 500
I'd like the result to also include the difference between EndTimestamp and StartTimestamp:
StartTimestamp | EndTimestamp | Difference
...
Say I have 3 queries. Query 1 returns a piece of information that Query 2 and Query 3 needs. Is there a way for Query 2 and Query 3 to access this piece of information from the result of Query 1?
Right now, I have Query 1 executing twice: once in Query 2 and once in Query 3. This doesn't seem efficient to me.
Is there a better way in M...
I have a dataset that looks like so:
id entry_id the_data
1 100 Z
2 300 B
3 100 C
4 200 F
5 300 Q
6 300 A
7 300 L
8 100 N
9 200 O
The results should give only the 3 most recent records (by id) for each corresponding entry ( by entry_id...
I have two databases, each containing email addresses of users. I've written a script that has the sole purpose of seeing which email addresses exist in both databases.
With that being said, please look at the following loops. Each loop contains hundreds of records (I've printed out the results from each as a verification). However,...
Hey
i am having a table with 8 column and following values
1 2 3 4 5 6 7 8
0 1 0 0 0 0 0 0
i need a query which will analyze the no of 1's and 0s in the column and if no of 0 is greater than 4 then it should print failed else pass,how can i do that? either by MYSQL or PHP?
...
Hi,
I am getting the error (mysql_fetch_row(): supplied argument is not a valid MySQL result resource in) for this query. Why?
<?php
set_time_limit(0);
//MySQL globals
$mysql_server = "***";//change this server for your Drupal installations
$mysql_user = "***";//Ideally, should be root
$mysql_pass = "***";//Corresponding password
$con...
category_product
---------------
id_category
id_product
product
---------------
id_product
id_manufacturer
manufacturer
---------------
id_manufacturer
name
How would I create an SQL query so that it selects all the names from manufacturer when id_category is equal to something?
...
I have a table with id column. ids are in ascending order but not necessarily consecutive. For example: 1, 2, 3, 5, 6, 10, 11, 12
I need to find the next "free" id, i.e. max(id) + 1 (or 1 if the table is empty).
Currently I'm doing this in PHP like this:
function get_free_id($con) {
$sql = "SELECT MAX(id) AS last_id FROM Table";
...
Given a table like this:
==============================================
| ID1 | ID2 | ID3 | Name | Value |
==============================================
| 16 | 1 | 100 | item_name | Toys |
| 16 | 2 | 101 | item_name | Computer |
| 16 | 1 | 102 | item_price | 55 |
| 16 | 2 | 103 | item_price ...
Can I modify the result that I have received from mysql_query than reset the pointer with mysql_data_seek($result, 0) and process the output like from normal query
Dummy example:
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$row[$fieldName] = $this->someFunction($row['id']);
}
mysql_data_seek($result, 0);...
Hi,
if is use this command in mysq:
SELECT node.nid AS nid, users.uid AS users_uid, node.created AS node_created
FROM dr_wiwe_node node
LEFT JOIN dr_wiwe_content_type_classified node_data_field_classified_valid_till ON node.vid = node_data_field_classified_valid_till.vid
INNER JOIN dr_wiwe_users users ON node.uid = users.uid
WHERE (
(
...
Hey.. I've run into a problem using several "like" in my sql-query (generated with Codeigniter's activerecord):
SELECT * FROM (`posts`) WHERE `city` LIKE '%test%' AND `title` LIKE '%%' OR `text` LIKE '%%'
Thing is, it appears to read this query as if there was a parenthesis around the first like and the second like, but I want there t...
I need to display a particular column in my SQL result only if it is not null. If it is null, I don't want that column to appear at all in my result. Is there a way to express this condition in SQL?
...
This is eluding me. I am trying to pull meta data about players that I have matched against each other in a game. Eg: Player 22 vs. Player 54
I have 2 mysql tables.
Table: players (id, name, image_url, etc)
1 | John | john.jpg | etc
2 | George | george.jpg | etc
3 | Ian | ian.jpg | etc
4 | Steve | steve.jpg | etc
Table: matchups (i...
Assume I have a table that has the following structure:
=================
| Id | ParentId |
=================
| 1 | 0 |
| 2 | 1 |
| 3 | 1 |
| 4 | 2 |
| 5 | 2 |
| 6 | 3 |
| 7 | 3 |
-----------------
This results in a tree like this:
1
/ \
2 3
/ \ / \
4 5 6 7...
hi every one..
load data local infile 'input.txt' replace into table t fields terminated by '|'; doesn't seem to replace the former contents, its creating duplicate copies of the entries, i tried with 'ignore' also,but even it is not working..pls tel me where i'm going wrong..
i created d table using...
create table t
(name varchar(2...
I'm performing an update on a MySQL table (myisam engine) that, according to the profiler, is spending an inordinate amount of time in the 'init' state:
mysql> show profile for query 2;
+----------------------+-----------+
| Status | Duration |
+----------------------+-----------+
| starting | 0.000057 |
| ch...
I have a table which has a column with numbers (no specific order).
What would be the shortest way to insert the minimal number in this column into $min variable in PHP ?
...