i have the video gallery in my database, which has over 200 000 videos.
in my home page in the site i show exactly some videos, which must satisfy to some criteria. and so, what is the question. is it a good way to sort videos every time the home page opene, or i must save the sort results somewhere in the database, and refresh them only...
SELECT DISTINCT wposts.*
FROM wp_2_posts wposts, wp_2_postmeta wpostmeta, wp_2_postmeta wpostmeta1, wp_2_term_taxonomy, wp_2_terms, wp_2_term_relationships
WHERE wposts.ID = wpostmeta.post_id
AND wp_2_terms.term_id = '8'
AND wp_2_term_taxonomy.term_id = wp_2_terms.term_id
AND wp_2_term_taxonomy.term_taxonomy_id = wp_...
I plan to store tags (like the ones on Stackoverflow) using the Toxi scheme
Tags are stored in a separate table.
create table tags
(
tagSeq int unsigned,
name varchar(255),
PRIMARY KEY (tagSeq),
UNIQUE INDEX (name)
);
In the add a tag usecase, multiple concurrent threads will be attempting to check if a particular tag exis...
I have a feeling that this query is pretty easy to construct, I just can't figure it out.
I want to replace all numbers in table X column C, with numbers in table Z column A, where numbers from table X column C matches numbers in table Z column B.
I hope that makes sense. Perhaps a little background information will make it clearer. I'...
hello guys..here i've a problem where i want to set the status whether it is approved or reject.. the condition are if admin select the registration number and driver name, that means the status is approve otherwise, if admin fill up the reason, that means the request is reject..
here is the code to set status
if ($reason =='null'){
...
Hi,
I was kinda surprised when I saw following:
CREATE TEMPORARY TABLE X (ID int) AS SELECT NumColumn FROM Table
I have tried to google it but only found using this as alieases. What this use actually is? I feel bit confused since I was stupidly creating temporary table and then fill it by using of insert..
Thank you
...
Hi!
I did an importer in VB .Net witch get data from an SQLServer an inserts this data throught ADSL connection in a remote MySQL server.
in the first time, it was like 200 records, but now there are more than 500.000 records and it expends like 11hours exporting all the data and that is bad, veryyy bad.
I need to optimize my importer,...
I want to hide all mysql error messages without using mysql_error().
Are there any solutions?
...
We need to redo a database in MySQL that has been already done on Informix, is there a way to migrate not only the schema, but the stored procedures as well?
Thanks.
We have a client whom we built a web application that uses an Informix database. Now the client wants to be able to implement the same software but on multiple closed netw...
Consider the following table which has the fields - id (int) and date_created (datetime):
id date_created
1 2010-02-25 12:25:32
2 2010-02-26 13:40:37
3 2010-03-01 12:02:22
4 2010-03-01 12:10:23
5 2010-03-02 10:10:09
6 2010-03-03 12:45:03
I want to know the busiest/most popular hour of t...
Hi
Say I have an ordinary table in my db like so
----------------------------
| id | username | password |
----------------------------
| 24 | blah | blah |
----------------------------
A primary key is assigned to the id column. Now when I run a Mysql query like this:
SELECT id FROM table WHERE username = 'blah' LIMIT 1
D...
I am trying to extract unix timestamp from mysql and convert it to ISO8601 timestamp. I need it in order to format date into facebook-like(or stack-overflow-like:) '30 minutes ago' instead of displaying the exact date and time. Has anyone dealt with it?
...
When I am executing following query then its not updating views column by 1 instead sometimes its updating it by 2 or 3. Say currently views count is 24 then after executing this query it becomes 26 or sometimes its 27.
$views = $views + 1;
$_SQL = '';
$_SQL = 'UPDATE videos SET views = '.$views.' WHERE VideoId= "'.$videoid.'";';
@mysql...
Hi, I'm planing to build some database project.
One of the tables have a lot of attributes.
My question is: What is better, to divide the the class into 2 separate tables or put all of them into one table. below is an example
create table User { id, name, surname,... show_name, show_photos, ...)
or
create table User { id, name, sur...
I'm doing an insert query where most of many columns would need to be updated to the new values if a unique key already existed. It goes something like this:
INSERT INTO lee(exp_id, created_by,
location, animal,
starttime, endtime, entct,
inact, inadur, inadist,
smlct, ...
Requirement : Should update MySQL database with that of MS Sql Server updates which reside on Linux and Windows hosting on the same web host 1and1. Accessing each other database from either server is not possible on shared hosting, thanks to 1and1's geniuses..
The solution I chose : I want to output all the active listings in a text for...
What would be equivalent of Number(4) of Oracle database to MySQL Datatype ?
...
I'm having some trouble comparing values found in VARCHAR fields.
I have a table with products and each product has volume. I store the volume in a VARCHAR field and it's usually a number (30, 40, 200..) but there are products that have multiple volumes and their data is stored separated by semicolons, like so 30;60;80.
I know that sto...
Ok so my admin sets to edit a book which was created. I know how to bring in the values that were initially entered via a simple text field like 'bookname'. On the edit book page the book name field stores the currently assigned 'bookname' in the field (which is what I want! :) )
However I have other field types like selects and radio b...
I have a command line script that uses the Django ORM and MySQL backend. I want to turn off autocommit and commit manually. For the life of me, I cannot get this to work. Here is a pared down version of the script. A row is inserted into testtable every time I run this and I get this warning from MySQL: "Some non-transactional change...