1
vote
4answers
76 views
Learning resources to transerfer my MS SQL Server knowledge into MySQL
I'm an experienced MS SQL Server developer
But with my first MySQL project I got problems with very simple issues
So can anyone suggest good resources helping me transfer my MS SQL Server knowledge …
1
vote
2answers
24 views
peoper sql query in mysql
I have table like this:
Name Result
T1 fail
T2 pass
T3 pass
T2 fail
T4 fail
T1 pass
T4 fail
Now, I want to get a results like this:
Name Result
T1 …
0
votes
2answers
15 views
escaping special character in mysql statements while using UPDATE…
I am trying to update a field using
UPDATE table set field='some_variable' where id=1;
The problem here is that the some_variable comtains data with multiple special characters in it. so I am not …
1
vote
7answers
52 views
Change Column to Auto_Increment
Hi,
I asked this question a little earlier today but am not sure as to how clear I was.
I have a MySQL column filled with ordered numbers 1-56. These numbers were generated by my PHP script, not by …
0
votes
3answers
41 views
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 …
2
votes
1answer
18 views
mysql date query which selects multiple dates
I need a single query that is similar to
SELECT datetime FROM blog WHERE UNIX_TIMESTAMP(datetime) < '".($date_string_in_seconds +1000)."' ORDER BY datetime DESC
but instead of returning the …
1
vote
2answers
23 views
mySQL: Updating multiple values in a record with a SELECT from another table
Trying to sort out the correct syntax for this UPDATE:
UPDATE `foo`
SET (`x`, `y`, `z`) = (SELECT `x`, `y`, `z`
FROM `bar`
WHERE `id` = …
0
votes
1answer
27 views
Alter MySQL column with values to auto increment
Hi all, I had a hard time with the title, so let me explain.
What I'm doing is using the jQuery UI to create sortable list elements on a page. Once the order is submitted, php assigns an incrementing …
2
votes
2answers
19 views
mysql result is “special character”-insensitive
Hi,
It seems that when i alter a mysql table (on a utf-8 table/columns) unique that it returns a duplicate entry error.
Example:
ALTER TABLE name ADD UNIQUE(name)
error:
Duplicate entry 'Adé' …
0
votes
1answer
31 views
make a fake schedule if dont exist in db
i want to pull all the rows from be database for a month and if there is any rows in beginning or in the end are missing, then i want to create fake rows, so everyday there is a 1 schedule that one …
1
vote
1answer
18 views
Locate Syntax in mysql
I'm trying to return all rows that content substring in mysql
and here is my code
SELECT Last_Name, Midle_Name, First_Name, Phone_home
FROM contact_info
LOCATE (@prefixText, …
0
votes
2answers
26 views
How to iterate by row through a mysql query in php
Ok, So I am trying to query my database and select all rows that have a certain value.
After that I turn the query into an array with mysql_fetch_array(), then I tried iterating by row through the …
0
votes
2answers
21 views
query builder of Visual Studio 2008 with mySQL
Hi, I am trying to filter my results in the query builder of Visual Studio 2008 so that when it executes the query to SELECT data from the field i chose, it will only retrieve last names that start …
0
votes
2answers
24 views
question about mysql query
I have got an mysql table containing data about companies: id, company name, city ,address, telephone.
I'm trying to write a querry for getting list of cities where there are more then 10 companies …
1
vote
1answer
19 views
insert if not exists else just select in mysql
I have one mysql table 'alfa' that will contain the primary key of another table 'beta' in one column. But if the entry in 'beta' can not be found I want to insert the value in 'beta' and use the new …
1
vote
3answers
42 views
Selecting max of a sum of two columns
I have a table comparisons. If I run
SELECT comparisonID,stu1Vers,stu2Vers,stu1,stu2
from comparisons
WHERE stu1!=stu2 and assignmentid=9;
I get something like:
…
2
votes
3answers
50 views
How to get values for every day in a month.
Data:
values date
14 1.1.2010
20 1.1.2010
10 2.1.2010
7 4.1.2010
...
sample query about january 2010 should get 31 rows. One for every day. And values vould be added. Right now I could do this …
0
votes
3answers
54 views
search big database
I have a database which holds URL's in a table (along with other many details about the URL). I have another table which stores strings that I'm going to use to perform searches on each and every …
1
vote
1answer
41 views
Need help on a JOIN query that almost works
I have four tables.
posts
| id | title |
+---------+-----------+
| 1 | hello |
| 2 | goodbye |
+---------+-----------+
posts_tags
| tag_id | post_id |
…
0
votes
1answer
13 views
mySQL -problem grouping and returning correct values using GROUP BY / HAVING
I have a crossReference table (crossref_room_subject) with conference room, meeting subject and timeSlot IDs. There are multiple entries per timeSlot. The subjectCode table includes a …
1
vote
1answer
19 views
Counting the number of select statements, connections per user in MySQL
Hi guys,
how can I count the number of connection and queries by user per day? I need a little list of users, previously registered in my MySQL Server, with the total of the queries and connections.
…
4
votes
3answers
73 views
Problem with MAX() and `group by` in an SQL query
Hi,
I'm writing a particularly troublesome query. It boils down to this:
I obtain a table of the structure:
pid | tid | points
after a pretty large query.
For ease of explanation:
pid = …
2
votes
3answers
52 views
PHP affected rows = 1 wont work properly.
Hi.
My script:
<?php
ob_start();
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('Content-type: …
0
votes
1answer
68 views
PHP and mySQL help
Hello there I have a database that has 2 tables in it, one is the categoryTable and the is the userMenuTable, the categoryTable currently has two columns in it, categoryId and categoryTitle
it …
0
votes
2answers
21 views
Using an index for a ranged where
im storing down ranks in one of my app, and i frequently do this:
select count(*) from table where score > ?
and ? = the current person's score. i intend to memcache this, and i use an index on …
1
vote
2answers
35 views
SQL query: get tags associated with post
I have three tables.
posts
| id | title |
+---------+-----------+
| 1 | hello |
| 2 | goodbye |
+---------+-----------+
posts_tags
| tag_id | post_id |
…
0
votes
2answers
21 views
MySQL: SELECT Like and char_length
Hi guys!
I'm trying to make a query, something like this: SELECT * FROM table WHERE field_name LIKE "keyword%" AND CHAR_LENGTH("keyword%")<20. I know this one is wrong and it's not working, but …
0
votes
2answers
34 views
mysql concate check not null
SELECT Concat(mp.cHospital ,',',mp.cHospital1,',',mp.cHospital2) as Hospital FROM TBL
I dont want to return null value,
how to check not null or how to make isset cond in query
1
vote
1answer
29 views
MySQL query for current GMT time
This sounds simple enough but I haven't been able to figure out how to use a simple SELECT statement to return the current time in GMT.
I have been trying to use CONVERT_TZ() to convert NOW() to GMT …
0
votes
5answers
39 views
Fatal error in php (exceeded 60s of exec time)
Hey ppl..
i wrote a code to update the password encryption in my site..
the code is..
<?php
$db= mysql_pconnect("localhost","root","root");
mysql_select_db("nitconnect");
$query="select password …