Tagged Questions
0
votes
1answer
11 views
MySQL - parse and move data from table 1 to table 2
Here's my situation - I have a large text table downloaded from the web and it is a series of 5 variables with fixed widths on each line - "space" delimited.
I'm using phpMYADMIN to upload data (I've ...
0
votes
1answer
28 views
Complex MySQL Query, Multi Table - How Do I Write This Relational Query?
I'm having issues writing this query, it's an odd relation that I can't figure out. I'm wondering if it would be better to just use 2 mysql queries and merge the results with php?... Anyways.. so here ...
-1
votes
3answers
26 views
Find equal columns in different tables in mysql
There are three tables, each one having approximatelly 60 columns and I have to find all the common columns between them.
Is there a way to find automatically the common columns between three ...
0
votes
0answers
8 views
Getting the children tables in a mysql database which uses MyIsam engine
I need a sql instruction in mysql that allows me to retrieve the children tables of a specific table, the peculiarity of this is that the database uses the MyIsam engine, I think this is possible for ...
0
votes
2answers
19 views
JQuery button style works in navbar, but not in table
I have used the exact same code in the navbar as in the table but it doesn't seem to work.
I am using js/jquery.mobile-1.1.1.min.js and Phonegap (Cordova)
Below is a screenshot of the what happens:
...
0
votes
1answer
39 views
MySQL Multiple Select Query
I want to create mysql request to the server I want to retrieve users from the table that as I do not have in friends list.
Here's how I'm trying to learn but I do not receive please help me
SELECT
...
2
votes
1answer
15 views
Long Running MYSQL Query, Frame Table and View with Grouping
I have a table t_date_interval_30 that is cartesian product of a 365 calendar year of dates, and a time field incremented at 30 minute intervals. I use this as a framework to hang call data on.
...
0
votes
3answers
25 views
Combining / Sorting two datetime tables/arrays/lists
I have two MySQL tables, both with Timestamp (DATE/TIME)... I need a query to combine them and sort them together, by timestamp (2013-08-21 13:13:47).
Table 1
---------------------------------------
...
0
votes
0answers
14 views
How to Truncate a huge mysql table
I have a table with 130824 records. Its Storage Engine is MyISAM. I want to truncate it. When i execute command on SSH, PHP script or phpmyadmin they show loading for long time but nothing happened. I ...
1
vote
3answers
50 views
Complex SQL Table Relationships? Needs Expert
I have a problem about database table and query of it. Let me tell what this is about. It is about project-manager-employee relationship. Now Let me tell in statements what their relationship...
...
0
votes
1answer
16 views
How to loop through rows in mysql table and delete those which have a certain value in a given field?
I have a mysql table with rows containing an integer field and from the PHP script, I need to delete those rows in table which have a field value (integer) lower than $minimum - how to achieve this?
0
votes
1answer
14 views
MySql | table autonumber reverting to zero over time
I have a MySql 5.1.52 database with a table which has consistently forgotten its autonumber sequence and then subsequently started from 1 again. It can take hours, days or weeks for this reset to ...
0
votes
2answers
56 views
MYSQL query SELECT from one table and join results with other table
Newbie here. So I apologize in advance if it's so simple to solve my problem, but I couldn't find any solution. I have two tables MESSAGES and USERS:
MESSAGES:
|id|user_id|message|1st number|2nd ...
1
vote
0answers
43 views
SQL count function without limiting list due to WHERE
I am pretty new to SQL and I am trying to generate a report that pulls from all kinds of different tables. The simple select lines that match up parts with KEYS is no problem. Although I am running ...
0
votes
2answers
43 views
Get row numbers for MySQL query, then filter where row number between values
I have seen some examples on StackOveflow of a query I needed to retrieve row numbers for a MySQL query. What I want to do is expand on that a little to allow me to then restrict the set of results ...
0
votes
1answer
24 views
How to display profile friends' avatars of a specific profile user?
I have 3 tables in my database
1) user_accounts which has id and avatars
2) user_friends which has uid and fid ( where uid = accounts id , fid = firends id)
3) Pages which has ...
-1
votes
1answer
15 views
Retrieved data from one column of database table into excel
I want to Retrieved data from one of the column of my table name "hote_line", the column name is "elite" and it contains data and i want to Retrieved data only from the column "elite". it contains ...
0
votes
2answers
23 views
How should I find the rows with a duplicate field in a big table?
I have a table with 1.5M+ rows for recording downloads from a website which has email address of the one who has downloaded something. I want to find those who have downloaded more than 100 times. ...
-2
votes
1answer
23 views
PHP/MySQL Multiselect from tables
please for some help I want this code show result only friends of $user_id but I want to show results from friends and $user_id
SELECT *
FROM
activity,
friends
WHERE
friends.user_id='$user_id'
...
0
votes
2answers
34 views
How Do You Compare 2 Records From The Same MySQL Table
Is a way to compare 2 records from the same table? I already compared two tables to make sure my records are accurate using
SELECT *
FROM `catalog_category_entity_varchar` c2t
WHERE NOT EXISTS (
...
2
votes
3answers
46 views
PHP/MySql HTML Table Grouping
I have a problem I cant seem to to wrap my head around.
I have a mySQL table setup similar to this:
userid date rating1 rating2
1 5/1/2013 5 ...
0
votes
1answer
24 views
SQL insert into row based on column value?
Looking for a query that can add based upon what a certain column returns.... the table looks like this.
`skillID` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`class` TINYINT(3) UNSIGNED NOT NULL ...
0
votes
1answer
47 views
Run query from an input tag from a table that was returned by a query
I have a php function that is running a query and returning the data in a table.
<?php
function displayrecords() {
$sql_json = "SELECT * FROM mytable";
$QueryResult = @msql_query($sql_json) or ...
0
votes
2answers
16 views
caching mysql table for performance
In my page, I have multiple queries to fetch data from same table with different scenarios. These multiple queries give me performance issues. So I am trying to cache the table and then query that ...
0
votes
1answer
14 views
Alter table for a datediff (MySQL)
I am trying to alter a table to change one of my column values to datediff() but I keep getting an error and I don't see where my issue is. Here is my code
alter table bids
modify column 'timeLeft' ...
1
vote
0answers
52 views
Mysql and php - not displaying data on php file
i am trying to learn some new stuff and always wanted to learn hoe tomake a website with php and mysql...
i found this easy tutorial and sample files to play with
...
1
vote
1answer
23 views
How to store CarName once and prevent duplicates storage?
I have a table called Person with the following attributes:
I want to implement a table called Car that will hold information regarding the cars a Person drives. I want to implement it in a way ...
-2
votes
0answers
11 views
Creating a table using variable name fetched from database
I want to create a table by fetching the table name from the database in the form of a row. my code is like this. table is not created using this code. Please help me.
<?php
...
0
votes
1answer
32 views
Select results from one query to another
SELECT id FROM table1 WHERE name LIKE 'test%';
That would show me all the ids in table1 with the id of anything that matched test%. So I have been doing this the long way doing this :
SELECT * ...
0
votes
2answers
33 views
Generate an xml file using DOM
I have a local sql table has these records in it
ID currentRank previousRank PlayerName Money
1 1 1 Max 15
2 2 2 ...
0
votes
3answers
39 views
How to phrase MySQL query to get daily totals for a column in groups?
Ok, so I have the following table structure:
vote_id date user source
-------- ------ ------ --------
1 2013-07-23 01:37:25 user1 ...
0
votes
0answers
48 views
As put where if the variable is greater than the condition?
I have two tables, one where you last put into the site, and the other with messages and date. The problem is that when I check with PHP for messages with the date greater than the last time I get ...
-2
votes
1answer
126 views
table does not exist error [closed]
$sql = "CREATE TABLE IF NOT EXISTS questions_$username(".
"question_id INT NOT NULL AUTO_INCREMENT, ".
"question MEDIUMTEXT, ".
"answer CHAR(1), ".
"PRIMARY KEY ...
0
votes
0answers
44 views
Display Table Data in the update form
I have created an update form and code for updating my 2nd table in mysql db. The update table code is working fine. The problem I have is how do I display the data from the 2nd table in the form ...
0
votes
2answers
38 views
SQL Query, how to get all elements from one list and only the similar ones from another table
I have 2 tables, and they have PartIDs as their similarity to branch them. I need to pull 3 columns from the first table and 2 columns from Table 2.
The problem I am having is that Table 1 ...
0
votes
0answers
32 views
Pull row data into modal window
I have a mysql query within a php function:
$sql_json = "SELECT * FROM mytable";
I am displaying the returned data into a table grid. The first row has an Edit button that once the user clicks on ...
0
votes
3answers
63 views
my database didn't update
<?php
$db = new mysqli('localhost', 'root', 'root', 'chatting');
$query = "SELECT * FROM user WHERE state = 1 AND getp = 0";
$result = $db->query($query);
$num_result = ...
1
vote
1answer
34 views
MySql Semi-Dynamic Table Names
I'm using a MySQL database to store individual tables for each 'data object', and PDO for access. The name of the table is stored in another database/table and so must be inserted into any abstracted ...
1
vote
3answers
29 views
MYSQL selection from tables
Hi i have client wich can have a project wich project can have galleries wich galleries have a imgs. So i create a tables: clients, projects, galleries, images in every table i have idetifier in ...
0
votes
1answer
15 views
Multiple Joins in SQL
I've been having a crazy time trying to make this SQL work.
Basically what I'm trying to do is get the count for how many rooms are currently booked today by room type. So far, I've been able to use ...
0
votes
1answer
37 views
Why am I getting resource id 13 in my query?
I am trying to run a query on getting the last 9 entries from the database, something simple i did in text, but trying to do it in a table form seems to mess it up. Here is my query code:
<?
$con ...
-1
votes
1answer
26 views
What is the result of a mysql SELECT query on a table already LOCKED (write) by another session?
Everything is in the title...
If i use:
LOCK TABLE tableA WRITE
commands
UNLOCK TABLES
What happen if another session/user tries to make a SELECT query on this table?
I can't find it in the mysql ...
0
votes
3answers
86 views
Mysql two tables, select all values from one table, compare if exists and then return One random value
I'm new here as for posting questions, but I've been looking for answers since long time ago.
Still what I'm trying to do now I didn't found for the right solution or I just didn't know how to use it ...
0
votes
2answers
53 views
Join two tables with one table has multiple rows matching
Trying to figure out if it is possible to create a query where you join tables, table one is smaller than table two, table two has multiple references matching table one entries, the query would ...
1
vote
1answer
32 views
MYSQL count based off of two tables
Sorry for asking this, but I haven't found an answer to what I'm trying to do anywhere!
Basically, I have a database with two tables. Below or two examples I'll use:
Table 1:
Process ID Date
...
-1
votes
2answers
42 views
How get multiple values from first mysql table and use it in second query?
table1
id | author | number_of_view |
---+--------------+-----------------
1 | john | 10
2 | Jack | 20
3 | Anna | 80
4 | Neri | 100
Below I ...
0
votes
1answer
18 views
Updating a Table Column from a Count in another table
I'm trying to update a column in a table with a result of COUNT from another table. Here is the code: (And it's working)
UPDATE software2
SET totalsoft = (
SELECT COUNT(*)
FROM links
WHERE ...
0
votes
2answers
35 views
Table name show a syntax error in MySQL
When I try to create a table with the following name in MySQL it show a syntax error but its not showing any problem if I use the phpmyadmin :
"attn-cse-a[3-1][mpms][10-8-2013]"
when I create a same ...
0
votes
1answer
44 views
Most efficient way to sort a leaderboard in sql and update it in a table using PHP
I might not have worded this right, but basically here is what I want to do:
Display the leaderboard in a HTML table
Each heading in the leaderboard is a link (e.g. score, time, kills)
When each ...
2
votes
4answers
38 views
Block access to Mysql Table inside Database
I have a website and a mysql db with 5 tables. One of them includes around 500 user emails. I am outsourcing the development of new features and I would like to block the access to the developer to ...