mysql

php/mysql open source customer service ticketing system ?

Hi all, I currently have a simple form for customer feedback / customer issues, this form send an email to [email protected] and then we check that and reply to any inquiries. I'd like to implement a proper ticketing system where a ticket is opened for each issue, and replies can be done via email or via a form (that displays all p...

Use Glassfish embedded with MySQL

Hi! Well, the title says almost everything, how can I define a jdbc-connection in an embedded glassfish to be able to use a MySQL database as a jdbc resource?? Thanks for your replies! ...

Easiest way to get count val from mysql in bash

Maybe i should use python or perl but i dont know any. I have 4 statements and i would like to check if there are any errors longer then an hour. My user is setup so i dont need to enter a mysql user/pass. This statement is in mysql_webapp_error_check.sh #!/bin/bash mysql testdb -e "select count(*) from tbl where last_error_date < DATE...

Codeigniter: Compare a MySql Datetime with Current Date

I need to compare a MySQL datetime with the current time, to get the dateDiff to show a messange if the MySQL datetime, is less than 30 days from today. I'm using codeigniter, and I tried a lot of helpers, and lots of thing, I just can't get to work. Some people says that is better to save in database a timespan, I just don't know wich...

Process multiple forms

Hi i'm using an jscript autosave script for my Form and I'm working on the backend submission part. Although its only 8 separate entries to be autosave, how can I $_POST with just one query... example user fills in there FirstName in script autosaves now the i'd like the backend script to do something like (see below). Is there a way to ...

How to return entire mysql table with php?

$result = mysql_query("SELECT * FROM users"); $values = array(); while($row = mysql_fetch_array($result)) { $values[] = array($row['tried']); } return $values; That only returns the word array when being called as a webservice. What am I missing or doing wrong? ...

Table Recovery Question

Suppose that I have a table with the following schema: tableId field1 field2 ..... I have two copies of my database (backup and production). On the production instance, a query was accidentally run which did the following: Update table set field2 = null where field1 = 'x'; I am trying to undo this query based on the data stored ...

SQL JOIN question (yet another one)

Sounds simple but I'm stuck Table A Table B col_a col_b col_a col_c 1 b 1 c 2 c 2 d 3 z 3 a 4 d 4 e 33 a 5 k 6 l 33 b 33 ...

Why is GRANT not working in MySQL?

I'm scratching my head on this one as I see a ton of helper websites showing how to create MySQL users and grant privileges but for some reason it just does not work for me. I tried on both WinXP and a MacBook Pro laptop with the latest MySQL version installed. The following is just an example from when I worked with WordPress. The ac...

SQL GROUP BY CLAUSE

I have a table where I'm trying to pull some trend analysis from where the columns are Date(timestamp),RiskCategory(text) and Point(int). What I'm trying to return is for every date SUM the points and group by RiskCategory. I can get the latest via the following: SELECT Date,RiskCategory,SUM(Point) AS Total FROM risktrend WHERE DATE(Da...

Mysql select list of items (repeat until certain amount)

I have the following structure: Table: products id, name, sort_order Let's say I only have 5 products, but I want 20. How would I loop through to get 20 results? Additionally, I'll need to start at a specific sort_order. So let's say I have 1,2,3,4,5 and I want to get 20 results and start at 3. It should end up as: 3,4,5,1,2,...

is there any way i could minimize this mysql query?

Hi, i am developing an application which have eight advertisement boxes, the advertisement data with position is stored into the database. the advertisement module works like first it will check if the particular position exist in the database (i.e 1 to 8) if it finds or not find it will return a Boolean accordingly. for that reason...

Weighted average calculation in MySQL?

I am currently using the following query to get some numbers: SELECT gid, count(gid), (SELECT cou FROM size WHERE gid = infor.gid) FROM infor WHERE id==4325 GROUP BY gid; The output I am getting at my current stage is the following: +----------+-----------------+---------------------------------------------------------------...

MySQL data storage question.

How would I store the following code below its output in my Mysql table? How would the field be made? md5(uniqid(microtime(),1)) example. field CHAR(128) NOT NULL ...

I have set php-mysql-apache to work on latin1 but when doing back-ups my character-set client is still utf8

Yes, I know what you think, but for the moment we decided to go for latin1. This is the mySQL config: • mysql> SHOW VARIABLES LIKE 'character_set_%'; • +--------------------------+--------+ • | Variable_name | Value | • +--------------------------+--------+ • | character_set_client | latin1 | • | character_se...

mysql retrieve partial column

I am using TinyMCE to allow users to write in what will eventually be submitted to a database. TinyMCE includes a button which will insert a "pagebreak" (actually just an HTML comment <!--pagebreak-->). How can I later pull back everything up to the first occurrence of the pagebreak "tag"? There might be a significant bit of data after...

MySQL's now() +1 day

I'm using now() in MySQL query. INSERT INTO table SET data = '$data', date = now() But I want to add 1 day to this date (so that date should contain tomorrow). Is it possible? ...

Adding minutes to datetime on insert - mysql

I've tried this INSERT INTO products (product_id, product_type, created_dt, end_dt) VALUES ('11', '1', '2010-10-08 00:11:10', DATE_SUB(2010-10-08 00:11:10, INTERVAL 59 Minute)) But this doesn't work. Any other ways to do this within Mysql? Thanks! ...

MySQL - Difference between Char and Varchar?

Possible Duplicate: What's the difference between VARCHAR and CHAR? what is the difference between CHAR and VARCHAR. ...

SQL Server Express alternatives beyond 2GB limit

In our project (which is fully developed using .NET), we use a medium sized database about 2 GB in size. Currently we are using SQL Express edition; How do the alternates for SQL Server Express perform? I am mainly considering MySQL and PostgreSQL. (Windows 7 x86, x64) Is there any compelling advantage to using MySQL or PostgreSQL? W...