mysql

VB.NET - Loading box/Catch PHP

Hi, How would I get a box in VB.NET that reads the status of my PHP side? E.g. http://www.youtube.com/watch?v=H8KbDcvUC6w - Look at "sending to shells" in the box all of the text in the box is from a PHP file. How would I get those message to load at that same speed? The video will clear up your minds. Thanks if helped. ...

Email list problem

My sql query to get all the e-mail addresses from my table is as follows: SELECT DISTINCT cEmail FROM tblUsers WHERE cEmail IS NOT NULL AND cEmail LIKE '%_@__%.__%' However, when I insert the list to gmail, it's still saying there are invalid e-mails. There are over 2000 e-mails and hard to go through each one to find out ...

Not exists in a update statement takes more time

In MySQL, update table1 t1 set column1 = 100, column2 = 200 where column3 > 500 and not exists(select * from table2 where column1 = t1.column1); This query is too time consuming to execute, do have any other faster way of rewriting. for table2 ID is a primary column so i guess ...

PDO Request Causing 500 Internal Server Error

This PDO request is not welcomed by my server for some reason. It makes the server throw a 500 Internal Server Error. All of my other PHP files are working fine and I haven't changed any server settings. Strangely though, It seems that when I comment out the line that binds the variable $u, it does not give a 500 error. I am perplexed. ...

mysql join query

I have 2 tables like this Table 1 id name 1 ABC 2 DEF 3 GEF Table 2 name meal ABC m1 ABC m2 GEF m1 Table 3 meal detail m1 mutton m2 beaf How can I get output like this? Id name meal_detail 1 ABC mutton,beaf 2 DEF 3 GEF mutton Thanks in Advance ...

3 way transaction deadlock in mysql innodb?

If innodb detects a 3 way deadlock, would it report on all the involved transactions in the "LAST DEADLOCK DETECTED" section of "show engine innodb status" ? Also when innodb reports a deadlock, why doesn't it ever report the locks TRANSACTION (1) holds? It reports locks TRANSACTION (1) is waiting for, It reports locks TRANSACTION (2) is...

Max Function in MySQL not working the way I thought it would

Basically, I am querying 3 columns in MySQL, Item_id, Date, and New_Qty. When I use the max function on the date column, the other columns all display their maxes for the same date range. SELECT `item_id` , max(date) AS max_date ,`new_qty` FROM `item_warehouse_link_history` WHERE warehouse_id =1 AND item_id=1000 AND DATE BETWEEN '2010...

Mysql: How to call sql script file from other sql script file?

Suppose I have wrote script Table_ABC.sql which creates table ABC. I have created many such scripts for each of required tables. Now i want to write a script that call all of these script files in a sequence so basically I want another script file createTables.sql. Mysql provides option to execute a script file from "mysql" shell applica...

MySQL Advanced SELECT help

Alright well I recently got into normalizing my database for this little side project that I have been creating for a while now, but I've just hit a brick wall. I'll try to give an understandable example of what I have and what I need to accomplish ― and hopefully it won't be too painful. OK. I have 3 tables the first one we will call ...

Problem with SQL query involving XOR-like condition

Let's say we have a table (EnsembleMembers) in an SQL database with the following data. It lists the musicians which are part of various ensembles, along with their instruments. EnsembleID (FK) MusicianID (FK) Instrument ---------------------------------------------- '1' '1' 'Clarinet' '1' '...

Shared MySQL database for ASP.NET and Java

I recently developed a Java Application for a client with MySQL database. Now he wants to have ASP.NET website connected with the Java Application. I'm thinking of placing the database on a local server which would support both the desktop application and the website. What i want to know is, is it the good way to handle these kind of s...

MYSQL Select on Trim

Really simple, I want to select all titles that starts with letter 'A' while ignoring the dash at the beginning of the string. SELECT * TRIM(LEADING '- ' FROM title) WHERE title LIKE 'A%' This just doesn't seem to work. Please help. Thanks. ...

Structuring a recipe database

I'm working on building a database that will search for recipes by ingredients. For example, I think I plan on populating the database with types of ingredients that are accepted, but I don't want to have to parse the string which includes all the ingredients in a particular recipe. I was thinking of making just like an list of acceptab...

SQL statement to update a percentage change

Hi guys. I have searched S.O. for this answer and have came close to an answer but still not close enough. I am interested in knowing if MySQL has this capability. I have developed in Perl and MySQL 4 and I'm on MySQL 4 now. My table looks like this... symbol varchar(25) todayDate date interest int(11) My problem is this.....these s...

PHP & MySQL Tickers..Is this standard practice?

I currently have about 4 different database tables which output to html tables. Each of these tables uses a count query to calculate data from a 5th table. That's no problem, but what about when I want to sort and order the data, and paginate etc (like with zend). If it were a one page table, I could probably sort an array. My thought ...

Prevent AJAX chat from showing duplicate messages (Javascript, PHP, MySQL)

I have made an AJAX chat using Javascript, PHP, and MySQL. I send the chat data with JSON from a PHP page that gets the data from a MySQL database. Each chat message is inserted into an array and pulled with an AJAX call every few seconds. Each row in the database has the timestamp of when the message was posted (the timestamp has the...

mysql: result counting data as encryption

i have a problem during count data use this query: SELECT A.*, COUNT( B.Serial_number ) AS Qty_insp, CONCAT(ROUND(A.`Reject_qty`/ COUNT(B.Serial_number)*100, 2),'%') AS NG_Ratio FROM oqc_defect A LEFT JOIN inspection_report B ON A.Model = B.Model AND A.Line = B.Line GROUP BY A....

selecting from one mysql table (friends) and ordering the results by fields in another table (users)?

How would I go about selecting from one mysql table (friends) and ordering the results by fields in another table (users)? The tables are setup as follows: CREATE TABLE `users` ( `id` int(12) NOT NULL auto_increment, `first_name` varchar(100) NOT NULL default '', `last_name` varchar(255) NOT NULL default '', PRIMARY KEY (`id`)...

PHP E-mail Script not working. What's wrong?

Any help would be much appreciated. Here is the code: <?php include 'header_admin.php'; ?> <?php include 'dbc.php'; page_protect(); checkAdmin(); ?> <?PHP require_once "Mail.php"; $con = mysql_connect("host","username","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db_name", $con); $elist = mysql...

How to automatically delete old records from a database table?

There is a database table for logging purpose only so old records are useless. Is there an easy way to automatically delete old records and keep most recent records only (say, records created in last 7 days, or, the latest 1 million records). The table uses MyISAM engine and have a timestamp column but do not have primary key (for fast i...