Finding the results of a select statement

I am new to SQL and am trying to pull some data from a database. I have two tables one called 'tblorders' and the other 'tblorderitems', to which I want to add up the number of items ordered by the team. This is the query I created: SELECT fldcustome

mysql sql conversion to sql server

I have a MySQL SQL that works fine with Jaspersoft report: SELECT pr.id AS project_id, pr.project_name as project_name, pr.export_event_id, au.full_name, ee.timestamp FROM ( SELECT project.id, project.project_name, MAX(project.export_event_id) AS max

The conversion from 'DBNull' to 'Double' is invalid

In my code I understand query getting null values and it throws this error. But since my query is little complex I don't understand how do I check for null values and avoid this error. Please help me to correct this query. SELECT (SUM(charges) + SUM(

Displays the table and values ​​using the drop-down list

In this application I have a drop down so you can select what table you want to view. Using Ajax I push the variable $tbl as an integer and the code below prints out the table that corresponds with that integer. Something is not working though and I

How do you perform a combinatorial label search?

I have 4 MySQL tables like this; Table1 ======================== id1 | brand | tags -----+-----------+------ 111 | mercedes | xx -----+-----------+------ 222 | mercedes | yy -----+-----------+------ 333 | ford | xx,yy -----+-----------+------ 444 | a

MySQL can not connect to db, but MySQL can

Config.php : define("DB_HOST", "127.0.0.1:1433"); define("DB_USER", "****"); define("DB_PASSWORD", "****"); define("DB_DATABASE", "name"); for some odd reason i keep on gettin

Phalcon PHP: Update a primary natural key

Is there a good way to be able to update a table which has a natural key in Phalcon? Consider this table: people ------ person created_at updated_at We're going to assume that the person field is unique and is the primary key. I try to do the followi

How to change unmodifiable / generated code in netbeans

I want to change the non-editable code in Netbeans , I want to replace the javax.swing.JTextFeild with ObservingTextField for which I have a class imported into my project in order to Implement a date picker But Netbeans Does not allow me to edit the

mysql: how to group multiple lines in a row

help me pls. my table in mysql look like this : kd_mapel|Sem1 |Sem2 |Sem3 EKO-001 |79 |NULL |NULL EKO-002 |NULL |80 |NULL FIS-001 |77 |NULL |NULL FIS-002 |NULL |76 |NULL FIS-201 |NULL |NULL |81 GEO-001 |79 |NULL |NULL INA-001 |79 |NULL |NULL INA-002

How do I access files located outside the root of the site?

I have fried my brain all day on this. Researching SO until my eyes are bleary...I need to know: How do I access files placed outside the site root? Background: Apache 2.0 dedicated server running Linux. Code: PHP and MySQL Reason: I want the files t

How to insert or update the mysql table with 3 keys

I have a real doozy for you guys. I have a table that looks like this in my mysql: location(char17), id(int9), sideid(int9), total(int9), other...(other) I have to insert into new things into this table ONLY if ID and SideID are not found, and update

Optimize the number of multiple rows

There are two tables: question and answer. In answer I hold user_id and question_id. I want to count how many times each choice is selected. Below is a working query, but instead of joining the same table 4 times, what is a faster way i.e. joining th

Mysql / PHP appends AND if multiple $ _POST data is entered

i have multiple POST data fields in a form and want to query to mysql database, if just one POST data field is entered every thing is working, but if theres two or more fields i get error because i need to enter AND between my questions. $sql ="SELEC

Mysql - Shoul I use the ID columns?

I have a doubt about best practices and how the database engine works. Suppose I create a table called Employee, with the following columns: SS ID (Primary Key) Name Sex Age The thing is.. I see a lot of databases that all its tables has and aditiona

Spring 2.5 Unable to get the JDBC connection

I'm using spring 2.5 SimpleJdbcTemplate to access MySQL db. When I try to access the DB too often(using Quartz to access it every minute) i get this stack trace: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection

MySQL - Index to accelerate queries with aggregated functions

As I understand, an index on a typical database table will provide a more efficient row look up. Does a similar construct exist for making queries with aggregate functions more efficient? As an example, let's say I have a table like below with a larg

admin-username proxy error

I tried to install proxy on development machine and I got the following error. /etc/init.d/mysql-proxyd start Starting mysql-proxy: 2011-02-26 15:51:45: (critical) admin-plugin.c:569: --admin-username needs to be set 2011-02-26 15:51:45: (critical) m

Standalone Web Server (PHP, MySQL) for Mac

I have to work at client's office on a Mac (I'm a PC user) and I can't install anything. I need a local web server to develop the app. Is there anything like http://www.server2go-web.de/download/download.html but for a Mac? Just so I can download it

Obtain additional data from the join table

Ok so i have this structure PRODUCTS * PRODUCT_ID (primary key) * PRODUCT_NAME CATEGORIES * CATEGORY_ID (primary key) * CATEGORY_NAME * CODE PRODUCT_CATEGORIES_MAP * PRODUCT_ID (primary key, foreign key to PRODUCTS) * CATEGORY_ID (primary key, foreig

Read a text file and upload the content to the mysql database

I need a php script to read a .txt file. The content of the text file are like this: data.txt 145|Joe Blogs|17/03/1954 986|Jim Smith|12/01/1976 234|Paul Jones|19/07/1923 098|James Smith|12/09/1998 234|Carl Jones|01/01/1925 These would then get stored

multidimensional PHP or multiple queries to mysql DB

I'm using the PHPExcel lib which it seems to do great jobs, but in my approach it doesn't seem to be so fast. I need to generate a excel file with allot of sheets, data, formulas and styles(bold, color, border) and it takes me allot of computing reso