Is there any way to get the if statement to evaluate a query?
SELECT if(5>0,'EQ_Type','*') FROM EQUIPMENT;
Resulting in:
+-----------------------+
| IF(5>0,'EQ_Type','*') |
+-----------------------+
| EQ_Type |
| EQ_Type |
| EQ_Type |
| EQ_Type |
| EQ_Type |
| EQ_Ty...
Hi,
I have a table called users with a column called activated_at, and I want to count how many users have been activated by checking if the column is null or not. And then display them side by side like this:
+----------+-----------+---------------+-------+
| Malaysia | Activated | Not Activated | Total |
+----------+-----------+-----...
Hey stackoverflow - This is my first question here.
I have 2 tables in my mySQLdb.
[tab_artist]
|id|artist|count
[tab_songtitle]
|id|songtitle|artistId
Im trying to select from both tab_artist.artist and tab_songtitle.songtitle as suggest where searchclause = m
I have tried this
SELECT artist, songtitle AS suggest
FROM tab_ar...
I'm trying to nicely output a data array (with Kohana v2.3.4), and am thinking there has to be a more efficient and elegant way to do this. My array looks like this:
array('category_id' => value, 'category_title' => value, 'posts' => array( 'id' => value, 'title' => value, ... ))
And here's how I'm outputting it in my view (some arr...
I'm researching some lightweight tools to backup a LAMP stack. The two most imporatant pieces are the
php codebase and
the mysql database.
I can tar/bz2 the code and a mysqldump and restore it on a new server (if the old one crashes) and this is more or less fine.
Anyway, are there more complete solutions to this?
e.g. track and...
At the moment, I have a Javascript (JQuery) front-end which periodically makes requests to a seperate, PHP script which returns posts.
For the sake of efficiency, however, I'd like to simply add new results to the array, not even looking at existing posts.
As it stands, I've attempted to do so with times (i.e. "SELECT * FROM table WHER...
Hi Guys,
I have multiple Mysql DB instances containing same schema but different data in the tables, running in my unix server.
I always have the issue of not upgrading all the instances at the same time, this leads into inconsistent of DB schema.
My question, is there any tool/script that can sync all my DB instances automatically once...
I am using ubuntu in VMWare. I installed mysql and have it running. I can login with the user root and a password. I have the IP of the VM box. In my code i wrote
using MySql.Data;
return new MySql.Data.MySqlClient.MySqlConnection("username=root;data source=192.168.100.129,password=xyz");
instead of data source i also tried server. I g...
Hello. I've been evaluating MindScape Lightspeed for the purpose of Model creation. So far I am satisfied. I was further looking for OOTB (actually some professional quality code) providers for MySQL for ASP.Net. I've come across 'dotconnect for MySQL' from Devart. This looks like fitting the bill for the latter requirement. It also has ...
Can anyone please help me in serializing resultset returned using mysqldb in python?
I get typeerror: datetime.date(2007, 11, 15) is not JSON serializable
What is the best way to do serialize into Json object in python?
I am using json.dumps(resultset) to serialize resultset...
...
I need help. What seems to be the problem with our php codes? We can't seem to insert our data into our database. I'm just a beginner and I'm tasked to store multiple data into multiple arrays into our database. What we're actually doing is to enter a number (ex: 5) and 5 forms should show within that page. each form would consist of nam...
I have a site that needs to search thru about 20-30k records, which are mostly movie and TV show names. The site runs php/mysql with memcache.
Im looking to replace the FULLTEXT with soundex() searching that I currently have, which works... kind of, but isn't very good in many situations.
Are there any decent search scripts out there...
Hi,
I have a three tables in an application and I need to perform a query which joins all three of them on a regular basis. Chances are that all three of these tables will be updated often.
I'm considering using a view to avoid having to use the verbose join syntax in several places within my code. Would this be a suitable options? ...
How do I convert this to use JOINS?
SELECT j.job_id, j.name AS job_name, a.name AS advertiser_name, j.time_added, j.active, j.moderated
FROM jobs j, advertisers a
WHERE a.advertiser_id = j.advertiser_id
...
I have a database which contains some numerical fields; now i want to create another field which displays the sum of one of these fields. How can I create that field?
thanks
...
I have a table containing (essentially) three columns - id, name, ref_id.
I would like to create an indented list where the columns with ref_id would be indented below the column with the corresponding id, for example:
Name | ID | Ref ID
about 1 0
story 2 1
history 3 1
contact 4 0
help 5 0...
When i use this it works fine
C:\Program Files\MySQL\MySQL Server 5.0\bin mysqldump.exe
--user=dinesh
--password=accounting
--host=dinesh
-C
--routines
--default-character-set=utf8
--Opt inventory
> C:\\R14122009_12469.Sql
But when t pass Path like
"C:\Documents and Settings\Wild\Desktop\f re...
Hi guys I was hoping from some help here, please.
I have a INSERT query to a table, after this is done I am calling:
mysql_insert_id();
In order to send the last ID inserted into the table to the next page like this:
$insertGoTo = "confirm_booking.php?booking_ID=" .$_POST['booking_ID']. "";
Unfortunately it does not work, all I ge...
is this a valid mysql statement ?
select * from TableA , TableB ;
if not what is the correct mysql statement for selecting the two tables.
why i think there's something wrong with this is i wrote a mysql statement
select * from TableA, TableB INTO OUTFILE 'c:/test.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '...
Here there,
Is there anyway of shortening this MySQL query at all??? It needs to grab two diffrent rows from the PriceRuleDetail table from the column called RuleValue based on it's price rule, but using an Alias, have them returned in the same row. It's using subqueries inside the select statement, which I assume is right, but there m...