hi,
I am working on a simple login and logout module for my website without any security. I am using wamp on a windows xp machine. I am creating session when a user submits the login informaton it redirects to a process.php file which creates the session variables and starts session. Now if the login is successful user is redirected to ...
Hello. I have a question: Is it possible to select form MySQL database by comparing one DATE string "2010-04-29" against strings that are stored as DATETIME (2010-04-29 10:00) ?
I have one date picker that filters data and I would like to query the table by the DATETIME field like this:
SELECT * FROM `calendar` WHERE startTime = '2010-...
I'm trying to execute this simple command:
create table foo
(clo int primary key unsigned auto_increment);
But I get this error:
ERROR 1064 (42000): 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 'unsigned auto_increment)' at
line 2
...
Morning y'all!
Basically, I'm using a table to store my main data - called 'Code' - a table called 'Tags' to store the tags for each code entry, and a table called 'code_tags' to intersect it.
There's also a table called 'users' which stores information about the users who submitted each bit of code.
On my homepage, I want 5 results r...
Hi,
I have a very large database with about 120 Million records in one table.I have clean up the data in this table first before I divide it into several tables(possibly normalizing it). The columns of this table is as follows: "id(Primary Key), userId, Url, Tag " . This is basically a subset of the dataset from delicious website. As I s...
Hello everyone,
I am trying to do file browser in a tree form and have a problem to sort it somehow.
I use PHP and MySQL for that. I've created mixed (nested set + adjacency) table 'element' with the following fields:
element_id, left_key, right_key, level, parent_id, element_name, element_type (enum: 'folder','file'), element_size.
...
In a table, there is a column that contains ids separated by comas ex: "159,167"
I want to do the equivalent of a join between this table and the table that contains those ids.
ex:
TableA TableB
id desc id desc tableAids stock
1 test1 1 abc 1,2,3 1
2 test2 2 def 1,2 0
3 te...
I can tell it best by explaining the query I have, and what I need.
I need to be able to get a group of items from the database, grouped by category, manufacturer, and year made. The groupings need to be sorted based on total amount of items within the group. This part is done with the query below.
Secondly, I need to be able to show ...
I have two tables that I need to join... I want to join table1 and table2 on 'id' - however in table two id is not unique. I only want one value returned for table two, and this value represents the sum of a column called 'total_sold' - within a specified date range (say one month), however I want more than one date range at the same tim...
I am using mysql/C++ connector to connect to a mysql database. I have some complex data structures so I need to serialize those and save in the database.
I tried something like the following.
vector<int> vectorTest(10,100);
istream *blob = NULL;
ostringstream os;
int size_data = sizeof(vector<int>);
blob = new istringstream((char*)&v...
Hello,
I am trying to post a form with two fields (name and email) into a MySQL table.
On local server (my laptop), it works just fine.
But on production server, it is posting twice!
I can't figure out why.
Here is the code:
$name = ucwords(strtolower(trim($_POST['name'])));
$email = strtolower(trim($_POST['email']));
$mysqli = ...
Hello all!
Im trying to use mysqldump like below:
mysqldump -hlocalhost -uadmin -padmin shop> D:\b2\shop3.sql
When i execute it in command prompt, the file shop3 is generated with all the tables from the shop database.
But, when I use it in my php file like below, it generates an empty file.
$cmd = 'mysqldump -hlocalhost -uadmin -pad...
How to pass the current date to a query in mysql like such query:
select from Dailytimesheet dailytimesheet where dailytimesheet.TrackingDate="2010-05-03"
...
Hi-- I'm stuck on a mySQL query using ON DUPLICATE KEY UPDATE.
I'm getting the error:
mySQL Error: 1062 - Duplicate entry 'hr2461809-3' for key 'fname'
The table looks like this:
id int(10) NOT NULL default '0',
picid int(10) unsigned NOT NULL default '0',
fname varchar(255) NOT NULL default '',
type varchar(5) NOT NULL default...
This problem is pretty hard to describe and therefore difficult to search the answer. I hope some expert could share you opinions on that.
I have a table with around 1 million of records. The table structure is similar to something like this:
items{
uid (primary key, bigint, 15)
updated (indexed, int, 11)
enabled (indexed, tinyin...
Hi,
I need to retrieve data from a specific time period.
The query works fine until I specify the time period. Is there something wrong with the way I specify time period? I know there are many entries within that time-frame.
This query returns empty:
SELECT stop_times.stop_id, STR_TO_DATE(stop_times.arrival_time, '%H:%i:%s') as stop...
Greetings,
I'm currently working on a multiple database rails application.
I want to off load the SELECT queries on to the slave databases
for only SOME of the databases or specific models.
The issue is that in places, we swap out the current database
connection and put in a different one for a short time; to load fixtures or
to hand...
I have a python script which reads email addresses from a database for a particular date, example today, and sends out an email message to them one by one. It reads data from MySQL using the MySQLdb module and stores all results in a dictionary and sends out emails using :
rows = cursor.fetchall () #All email addresses returned that ar...
Query to find "All bars that sell three different beers at the same price?"
My Tables are
Sells(bar,beer,price) - bar - foreign Key..
Bars(name,addr) - name primary key.
I thought of something like this but that dosent seem to work ...
Select A.bar As bar , B.bar as bar
From Sells AS A, Sells AS B
Where A.bar = B.bar and A.b...
Under the structure tab, when EXPORTing a database using phpmyadmin there is a check box labeled:
Add DROP TABLE / VIEW / PROCEDURE / FUNCTION
What does this do?
...