I'm having trouble wrapping my head around how to set this up. I have two tables:
Projects
Sections
1 project can belong to many sections.
1 section can have many projects.
How would I go about setting this up, would this be a many to many relationship or one to many?
Would it best if I created a lookup table?
...
The query:
SELECT id_user
FROM Rating
Where id_movie=2
INTERSECT
SELECT id_user
FROM Rating
Where id_movie=3
but I get:
1064 - 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 'INTERSECT SELECT id_user FROM Rating Where id_movie=3 LIMI...
Basically I want is to aggregate some values in a table according to a timespan.
What I do is, I take snapshots of a system every 15 minutes and I want to be able to draw some graph over a long period. Since the graphs get really confusing if too many points are shown (besides getting really slow to render) I want to reduce the number o...
I have these two classes in my database package:(DBManager and TaskManager class)
and I create a new object in my main frame which is in the other package and I also imported the database package for my main frame and I call addBirth() on my object,and I want to insert these arguments in my table="birthsql" in MySQL but I found this exce...
I issued a command of:
DROP USER 'root'@'localhost'; GRANT ALL PRIVILEGES ON . TO 'root'@'%';
...in PhpMyAdmin. Immediately after the execution, I was forced out PhpMyAdmin. I got:
error
#1130 - Host 'localhost' is not
allowed to connect to this MySQL
server,
how to resolve my problem?
...
Using this query,
SELECT company, YEAR( date ) as year, COUNT( * ) as total
FROM table
WHERE company = "Medtronic"
OR company = "Private"
GROUP BY YEAR( date )
I get a table like this:
Company year total
Medtronic 1998 6
Private 1998 5
Medtronic 1999 5
Private 1999 1
How do I calculate the % that is cont...
I am building a site for a magazine that includes three different sections- articles, blog posts, and reviews. All three of these object types have the following columns in common: title, description, headline, subheadline, body, and author. Should I store them each in their own table, or should I just create one Posts table and add a ca...
I did a wipe and restore.
I backedup my current innodb tables. (mysqldump)
I loaded it into the database.
For some reason...the tables are now all myisam instead of innodb...weird!
I try to do:
ALTER TABLE xxx ENGINE=innodb;
And it doesn't do anything to any table.
"Show table status" still is "MyISAM"
mysql> alter table auth_use...
I am creating a search engine for my php based website. I need to search a mysql table.
Thing is, the search engine must be pretty 'smart', so that users can easily find their items (it's a classifieds website).
I have currently set up a FULLTEXT search with this piece of code:
MATCH (headline) AGAINST ($querystring)
But this is...
My php script is working on localhost but after uploading online it's showing a blank page.
php installed on localhost version 5.2.6
php installed on production environment version 5.1.4
<?php
define('INCLUDE_CHECK',true);
require 'connect.php';
session_start();
php require 'function.php';
?>
<html>
<head>
</head>
<body...
will the sql queries i run in ms-access also work on mysql without any changes ?
...
I'm working on a football site witch, along with many features, list result tables. The tables are separated between seasons (season name, etc) and rounds (witch are generated everytime a new season starts up, like 2008/2009, 2009/2010, etc)
rounds table has a start date and a end date, and the only way I have to dinamically know wich r...
I am putting together a nice little database for adding values to options, all these are setup through a map (Has and Belongs to Many) table, because many options are pointing to a single value.
So I am trying to specify 3 option.ids and a single id in a value table - four integers to point to a single value. Three tables. And I am runn...
Im trying to get the function below to return TRUE if it finds a matching row, and FALSE if it finds 0 rows.
function IsOpenEvent($id) {
$result = mysql_query("SELECT * FROM `events`
WHERE `access` = 'public'
AND `id` = '$id'
LIMIT 1")
...
how to import excel 2007 file containing 0.4 million records into mysql table ? please suggest
appreciate any help
...
I have these two classes in my database package:(DBManager and TaskManager class)
and I create a new object in my main frame which is in the other package and I also imported the database package for my main frame and I call addBirth() on my object,and I want to insert these arguments in my table="birthsql" in MySQL but I found this stac...
We currently have a table setup to keep track of cache file names or memcached key references. The table exists so that when a comment is added or more content is added the system automatically purges those cache files/key-value pairs that are affected by the update so the rebuild the next time a user accesses the page the user sees the ...
i have a table with products and the user can choose which regions and cities he wants to let them be visible to. he can choose ALL REGIONS and ALL CITIES from a drop down menu and then i will put in the columns = 0.
the the buyers can choose which city they want to watch products from so they aslo have a drop down menu to pick a region...
Is there any good rating and voting script tutorials that use PHP and MySQL? If so can someone point them to me so I can check them out.
...
I have a table that uses Adjacency list model for hierarchy storage. My most relevant columns in this table are therefore:
ItemId // is auto_increment
ParentId
Level
ParentTrail // in the form of "parentId/../parentId/itemId"
then I created a before insert tigger, that populates columns Level and ParentTrail. Since the last column al...