I have 1 table called urltracker that holds information about the number of times a specific url has been clicked. The table is structured into 4 columns id, urlclicked, referrer and timestamp. The urltracker creates another entry in the table every time a url has been clicked.
What i would like to do is display a specific url and the n...
We are porting an app which formerly used Openbase 7 to now use MySQL 5.0.
OB 7 did have quite badly defined (i.e. undocumented) behavior regarding case-sensitivity. We only found this out now when trying the same queries with MySQL.
It appears that OB 7 treats lookups using "=" differently from those using "LIKE": If you have two valu...
If i have a parameterized SQL statement like this:
SELECT * FROM table WHERE my_field = :field_value
Does anyone know if PDO will recognize this(see below) as the same SQL statement and use the cache instead of assuming it's a completely different SQL statement:
SELECT * FROM table WHERE my_field = :new_field_value
So, I guess the...
Hello,
I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I basically want to get the list of ID's of people who have favourited that item (this is a bit simplified, but this is what it boils dow...
I'm making a simple tool that will get a string of MySQL commands and run it on several DB servers sequentially. I trust the users to be sensible, but mistakes happen. I'm wondering:
Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they're syntactically correct?
In other words,
SELECT * FROM x;
or...
mysqldump is probably not the best idea on running backups every x hours but is the one that we are currently using. The backups are around 150 Megs each so sending it to other machines could waste many gigs of bandwidth.
Is there any tool or application or script that could automate the creation of the backup and the upload to s3 am...
hi all ...
i have sql statement like this
SELECT DISTINCT results_sp_08.material_number FROM results_sp_08
INNER JOIN courses ON results_sp_08.material_number = courses.material_number
INNER JOIN users ON results_sp_08.id = users.id
AND results_sp_08.doctor = 'xx260'
i need alternative way to DISTINCT in to use it in MySQL ve...
The application that I am working on generates files dynamically with use. This makes backup and syncronization between staging,development and production a real big challenge. One way that we might get smooth solution (if feasable) is to have a script that at the moment of backing up the database can backup the dynamically generated f...
I have a live search on my help page that searches our help database and returns the relevant results. I figure that a good way to decide what needs more documentation would be to log searches that return no results to our database.
Normally, this would be really simple, but that fact that it's a live search has made it a bit more tric...
Hi. I am just learning php as I go along, and I'm completely lost here. I've never really used join before, and I think I need to here, but I don't know. I'm not expecting anyone to do it for me but if you could just point me in the right direction it would be amazing, I've tried reading up on joins but there are like 20 different met...
I have two versions of my application, one "stage" and one "dev."
Right now, "stage" is exposed to the real world for beta-testing.
From time to time, I want an exact replica of the data to be replicated into the "dev" database.
Both databases are on the same hosted Linux machine.
Sometimes I create "dummy" data in the development en...
I have a script that did double inserts into the database with the same data. Is there a good way to do this (without scanning through, inserting every record into an array, and then deleting duplicate array entries)?
...
Basically I want to put "todays" year, month, day into two fields ... something like the following. Tried varients of but cant get it right
"INSERT INTO film_out (start_year, start_month, start_day), (end_year, end_month, end_day) VALUES ('$year', '$month', '$day') "
...
I've created a table in MySQL:
CREATE TABLE actions ( A_id int NOT NULL AUTO_INCREMENT,
type ENUM('rate','report','submit','edit','delete') NOT NULL,
Q_id int NOT NULL,
U_id int NOT NULL,
date DATE NOT NULL,
time TIME NOT NULL,
rate tinyint(1),
PRIMARY KEY (A_id),
CONSTRAINT fk_Question FOREIGN KEY (Q_id) REFERENCES questions(P_id),
CON...
How do I check if a user/password pair works without actually making a connection to the database?
The DBMS in question is MySQL.
That was my original question. Since most people get this question wrong, then I should rephrase it as:
How do I check if a MySQL username/password is valid, without connecting to MySQL as that user? (thanks ...
I'm attempting to join a table on itself using doctrine's DQL. The scenario is:
I have a table of product attribute values at is linked to a products table via a reference table. The product attribute values are to serve as filters on the products, therefore, the products attribute values table needs to be joined back onto itself to ...
I have two tables in a MySQL database
urltracker with columns id and urlclicked
and urlreferrer with columns id, url_id and urlreferrer
the urltracker is really just a lookup table with the url_id column in the urlreferrer table being the link between the tables.
Example DDL:
CREATE TABLE urltracker (
id SERIAL PRIMARY KE...
I'm at square one on a project that will need to repeatedly import data from MySQL *.dmp files into an existing Sql Server database. I am looking for guidance in the form of an existing tool, framework, or, barring pre-existing solutions, suggestions for how to proceed.
My first thought is to read the dmp file in as text and perform so...
I am trying to create a column in a table that's a foreign key, but in MySQL that's more difficult than it should be. It would require me to go back and make certain changes to an already-in-use table. So I wonder, how necessary is it for MySQL to be sure that a certain value is appropriate? Couldn't I just do that with a language li...
How would you write a sql statement that allows you to insert data obtained from a form but will be entered in either one tabe or another depending on what is selected on the form? I know how to insert the data from a form to a specified table but I need to be able to use the form to select which table the data will be entered into. He...