Is it possible to combine the CASE statement and the LIKE operator in a MySQL SELECT statement?
For Example, I am trying to query a database that stores data in a single column in either one of two formats (this is awful and hurts my head, but I cant change the data so it is what it is.). So sometimes the column numbers would have data ...
I need some help figuring out why the following scenario does not work. I'm trying to retrieve a value from the last updated ID in mysql, then pass that value via javascript over to an ajax call which calls a .php page, which also calls another function "ZEND_emaiL" in a different php page.
In the very first php page that retrieves the...
How to set a field auto increment without auto increment key in mysql or how set a field auto increment with start value 6000 in mysql?
...
I believe I my understanding is correct that there is a standard SQL. I'm assuming that MySQL, SQLite, and PostgreSQL all have variable support for the standard. Can anyone point me to a comprehensive comparison table that shows the differences?
...
I want to join two tables (below) which i get. But then I want to do a count to see how many times each job_category is shown when contactId > 0
Any Help would be appreciated!
Tablel :
| JobPositionId | JobPositionName | JobDescriptionId | JobCategoryId | ContactId
----------------------------------------------------------------------...
I have an excel spreadsheet with products and categories with a many to many relationship and i need to populate the db with it. I am searching for a quick way to enter this data in and have the join table have all the correct info. I have phpmyadmin but it seems to be a bit slow unless there is a shortcut. Another approach i was thinkin...
Im building a file manager which allows users to create folders within folders (within folders) to store their files. I didn't put a real limit on the depth of folders, but I'll probably make it 10 or something like that.
How could I list all the folders (in a tree structure) inside the drop down menu, like so?
/
/Folder 1
/Folder 2
...
How can I get a List all the JobPositionNames having the lowest jobPositionId when ContactId = 1
Tablel :
| JobPositionId | JobPositionName | JobDescriptionId | JobCategoryId | ContactId
---------------------------------------------------------------------------------
1 | Audio Cables | 1 | 1 ...
I want all my dynamic generated php links to be displayed like in example 1 below and when I click on a link which takes
me to another page all its sub links are displayed like in example 2 and when I click on one of those links all its sub
links are displayed like in the rest of the examples.
I'm using PHP, MySQL and Jquery for my we...
I'm trying to set up replication on a couple databases and have just run the change master command. I got very little feedback from the command:
Query OK, 0 rows affected (0.07 sec)
I want to know whether this step has succeeded or not. So, is there a way to find out who my slave db thinks is its master?
Thanks.
...
I have a photo gallery that has a previous and a Next link. When it gets to the last image it stops there. I want it to start over at the first picture. The function is a for loop and I think it should be a while loop and some things changed to make it an infinite loop. I just don't know how to convert this function. Still not that stron...
I'm trying to find the most efficient way of dealing with this but I must tell you front-head I've made a mess of it. Looked around SO and found nothing of relevance so here it goes.
How to select all projects that have similar tags to the desired project?
Take this table for example:
(sql code to recreate tables bellow)
project 1 -...
I have been using php for quite a sometime now and encounter three different interfaces viz. mysql_*, mysqli_* and PDO to connecting with mysql database. What i am not able to understand is why to have so many interfaces for the same.. if one is better then which one?? or is it a matter of choice between select one or other. Does there e...
Hi, i was trying to optimize some queries on my MySql Db when i found myself in a doubt.
The problem: two similar queries produce almost the same result but the one I tought would be more expensive it isn´t,
Having this table:
CREATE TABLE `da_video_votes` (
`video_id` int(10) NOT NULL,
`user_id` int(10) NOT NULL,
`type` enum('l...
Hello,
I have an issue that i'm about to pull my hair out over, ok let me start.
I'm using php and mysql i have a database that holds rows with information and one of the columns has a datetime field in a 24hr format.
I am trying to retrieve information using the following query:
SELECT * FROM `table`
where `new` != '1'
AND `time...
hi,
i have a highscore system in that i have small doubt like i want to store the user session in the mysql table and also the guest session. like if the user is registered user then that session should be stored in the mysql db. else if the user is not registered i.e guest user then also i need to store with the guest account for my hig...
Hi guys, I would like to perform a SELECT query with MySQL. My goal is to select all the dogs in a vet database that would be sex=male and fur=short and (color=black or size=big)
Note: I want to select dogs that are either black or size are big. They don't have to fulfill the 2 requirements. They just need to fulfill either one.
I have...
Hello All,
I have created a crystal report using MySql 5.1, using XML (Dataset save as xml in application root folder) now when i run on my machine it works fine. But when app is installed on other machine it give database login required. how can i remove that login window ? The code is given below
cDataSet.DataSetNam...
I am using indexing for mysql tables.
My query was like this
EXPLAIN SELECT * FROM `logs` WHERE userId =288 AND dateTime BETWEEN '2010-08-01' AND '2010-08-27'
I have indexing on field userId for this table logs,
and the result of explain query is like below.
id select_type table type possible_keys key key_len r...
hi guys, I am working on a new system and am stuck at a point with jquery + ajax.
My problem is this, how can i validate multiple fields in my registration form using ajax. I don't want to create a separate validation for each input fields.
can you help me guys, please. :-(
Thanks a lot.
...