mysql

How to use the mysql "LIKE" syntax with a timestamp?

I want to allow my users to search the database for a row that was submitted on a certain day. The date is entered into the field in the database using the date() function which is great, but when i use the php strtotime function, of course the dates are not exactly the same. Is there some clever mysql function that can help me with thi...

MySQL Query WTF

Can anyone help me understand or post any ideas concerning this where clause? sql was here I've changed the table name, but other than that, any idea what the developer was trying to do here? There is nothing else after that, that's the where clause. ...

MySQL query help (involving joins?)

Although I've figured out several queries that almost do this, I can't quite get it perfectly and I'm getting frustrated. Here is the setup: Table: Issue | id | name | value | +-------------------+ | 1 | a | 10 | | 2 | b | 3 | | 3 | c | 4 | | 4 | d | 9 | Table: Link | source | dest | +---------------+ | ...

PHP/MySQL database design for various/variable content - modular system

Hello, I'm trying to build (right now just thinking/planning/drawing relations :] ) little modular system to build basic websites (mostly to simplify common tasks we as webdesigners do routinely). I got little stuck with database design / whole idea of storing content. 1., What is mostly painful on most of websites (from my experience...

Creating mysql table with explicit default character set, what if I don't?

In mysql 5.x Whats the difference if I do something like this: CREATE TABLE aTable ( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, aNumber bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARACTER SET=utf8; with this: CREATE TABLE aTable ( id BIGINT NOT NULL AUTO_INCREM...

Upgrading vb6 application to visual studio 2008 with Mysql ODBC driver

I am very "lucky" to get to work with a VB application that was originally written in vb6 with an old version of Mysql ODBC connector. The problem is i can't open the project in my copy of VS2008 because i don't have the needed file MyVbQl.DLL and i can't find it anywhere on the internet and also Mysql ODBC connector versions 3 and 5 do...

MySql conversion problem : from UNIX_TIMESTAMP to INT(11)

Hello, Running the below select on a MySql table containing 1500000 rows will take approximately 5 mins 30 seconds. SELECT * FROM my_table WHERE timestamp BETWEEN UNIX_TIMESTAMP('2008-04-23 01:37:02') AND UNIX_TIMESTAMP('2008-04-23 01:37:03') [Executed: 25/01/10 5:32:47 EST PM ] [Execution: 231094/ms] Converting and replacing the...

Drupal-6: What's wrong this this node?

I have some nodes that I have manually written to the database. (Don't ask why; it's easier than other options.) They show up fine on the Content List at http://www.domain.com/admin/content/node/overview. However, when I go to that node's page (http://www.domain.com/node/2582/view, where 2582 is the nid of the node in question), I get a ...

MySQL—SUM multiple COUNTs?

I have to get some data that if possible should be done in one query—if push comes to shove I could always write some PHP logic to do it in two, but I’m thinking that it would be possible to do it in a single query. I don’t know how! Here is what I want to do: Generate a listing that displays the total number of posts by an author. The...

returns Zeros for Dates that dont exist MYSQL GROUP BY

SELECT AVG(data) AS data, dateReg FROM table GROUP BY YEAR(dateReg), MONTH(dateReg), DAY(dateReg) ORDER BY dateReg the Above Data Returns 1.75, 21 Jan 2010 9.45, 22 Jan 2010 3.96, 23 Jan 2010 2.68, 30 Jan 2010 Its missing dates from the 24th to 29th, Can we do it so the return value is: 1.75, 21 Jan 2010 9.45, 22 Jan 2010 3.96, 2...

JSON VIEW using GROUP_CONCAT question

Hey DBAs and overall smart dudes. I have a question for you. We use MySQL VIEWs to format our data as JSON when it's returned (as a BLOB), which is convenient (though not particularly nice on performance, but we already know this). But, I can't seem to get a particular query working right now (each row contains NULL when it should con...

Having an odd problem with mysql_fetch_array()

Why am I not able to get inside the while loop in the getCustomers() function? $stores = $bl->getStoresForGuide($gID); //Returns 6 stores $storelist = getStoreList($stores); //Generate the HTML for the store list $brandlist = getCustomers($stores); //Generate the HTML for brand list function getStoreList($stores) { while ...

Setup MySQL query timeout

Hey guys, it's possible to timeout query in MySQL? So if any query will exceed this timeout, it will be killed by MySQL and it will return error instead of waiting for eternity. ...

Using LOAD DATA INFILE with arabic data

I am trying to import a .csv file into a table. I have figured out how to get the data inserted by using the following query: LOAD DATA INFILE 'examplesofdata.csv' INTO TABLE coins FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' IGNORE 1 LINES; However for several of my fields I have Arabic content which gets entered as a s...

When the .net 4.0 and vs2010 beta2 will support mysql

mysql server explorer cannot support vs2010 b2 who has a solution ...

Best way to delete mysql rows from html page - delete link and php

I'm returning all rows in a table with a while statement and PHP. the rows indicate a list of items. I'd like to include delete links next to each item so users can delete the entries. I'm trying to figure how to go about it in PHP. Can anyone help me write the script.. I'm using procedural.. not OOP. I'm thinking the link takes users to...

MySQl Workbench and RadRails

Hi, Anyone know how to fix this? In Aptana Radrails I created a model called employee, but I am unable to use the rake function to create the table "employee" in MySQL workbench. I have a database labeled company_development in My SQL Workbench and database called "Company" in Radrails. I get the following message: (in /Users/Home...

Maximum Number of Tables in MySQL

What is the maximum number of tables that MySQL can handle? Thanks in advance. John ...

Database design, two types of users for website

I'm making a review type website, and I would like for there to be 2 types of users. One would be the majority, reviewers while the other would be the person the review is about. How, in terms of database design would I differentiate the two. Should I have separate tables for reviewers and reviewies or simply assign a different range ...

SOLR commit and optimize questions

I have a classifieds website. Users may put ads, edit ads, view ads etc. Whenever a user puts an ad, I am adding a document to solr. I don't know however when to commit it. Commit slows things down from what I have read. How should I do it? Autocommit every 12 hours or so? Also, how should I do it with optimize? Please give a detaile...