mysql

Spring DatasourceTransaction Manager Problem

final DataSource ds = DataSourceLocator.getInstance() .getDataSource(sg.cmpl.starhub.lprs.Constants.APP_KEY); final DataSourceTransactionManager txManager = new DataSourceTransactionManager(); txManager.setDataSource(ds); final DefaultTransactionDefinition def = new DefaultTransactionDefinition(); def.setIsolationLevel(TransactionDe...

Ubb forum error Unable to connect to the database!

I have recently migrated my ubb forum website to a new web hosting server, I have placed the files on new server and I think directory structure is right and also set up the database through phpmyadmin, and changed config file accordingly but still I am getting this error UBB Message We encountered a problem. The reason reported was Sc...

MySQL Query Selecting records from a database where a value equals one of two different things

I have to get records from my MySQL DB where: sentto = "$username" OR sentto = "everyone" How would I put this in a MySQL query? I tried a few things, but they don't seem to be working: mysql_query("SELECT * FROM pmessages WHERE status='unread' AND sentto='$username' || sentto='everyo...

How do I use EXPLAIN to *predict* performance of a MySQL query?

I'm helping maintain a program that's essentially a friendly read-only front-end for a big and complicated MySQL database -- the program builds ad-hoc SELECT queries from users' input, sends the queries to the DB, gets the results, post-processes them, and displays them nicely back to the user. I'd like to add some form of reasonable/he...

Changing SQL CONSTRAINT Based On Other Fields

I have an SQL table written in MSSQL: create table [action] ( action_id bigint identity not null, -- PK action_action char(1) not null, -- 'C' Call, 'R' Raise, 'F' Fold, 'P' Post action_size decimal(9,2) not null, -- zero if fold, > zero otherwise constraint pk_action primary key clustered (action_id), constraint...

Better PHP,MySql,HTML and JavaScript IDE

Hello guys, I am currently using the below IDE's. They serve their purposes but am wondering if there are better ones out there that i can switch to. phpDesigner v6.2.5 (For PHP) Navicat 8.0.29 (For MySql) Dreamweaver CS3 (For HTML & CSS) Spket IDE (For JavaScript) Thats my collection of production tools. Wondering if there is anyone ...

Optimizing a PHP page: MySQL bottleneck

I have a page that is taking 37 seconds to load. While it is loading it pegs MySQL's CPU usage through the roof. I did not write the code for this page and it is rather convoluted so the reason for the bottleneck is not readily apparent to me. I profiled it (using kcachegrind) and find that the bulk of the time on the page is spent doin...

Can this be written in a better way?

I have these two tables: CREATE TABLE x ( id INT NOT NULL, exclude BIT NOT NULL, PRIMARY KEY (id) ); CREATE TABLE y ( id INT NOT NULL, field1 INT NOT NULL, field2 INT NOT NULL, field3 INT NOT NULL, field4 INT NOT NULL, field5 INT NOT NULL, PRIMARY KEY (id) ); And this sproc: CREATE PROCEDURE p...

What's the fastest way to import a large mysql database backup?

What's the fastest way to export/import a mysql database using innodb tables? I have a production database which I periodically need to download to my development machine to debug customer issues. The way we currently do this is to download our regular database backups, which are generated using "mysql -B dbname" and then gzipped. We ...

Find all records in database that are within a certain distance of a set of lat and long points

I've seen all the examples and here's what I got so far. my table is simple: schools (table name) - School_ID - lat - long - county - extrainfo here's my code: <?php $con = mysql_connect("xxx","xxx","xxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } else {} mysql_select_db("xxx", $con); $lat...

how to add a port to mysql server

I wont to add to mysql other tcp port that he will be lessen to and i will be able to connect to that port from my application i have duplicate my appliction and i runing them both from the same machine they both connected to the mysql server that are running on the same machine the problem is that the default port 3306 all ready ta...

Performance on having different file for tables in MySQL.

In MySQL, we have an option to have separate file for tables. I just wanted to know if using this option would decrease performance,for example in querying tables. ...

mysql warnings

Hello everyone. I have the following table: CREATE TABLE `events` ( `evt_id` int(11) NOT NULL AUTO_INCREMENT, `evt_name` varchar(50) NOT NULL, `evt_description` varchar(100) DEFAULT NULL, `evt_startdate` date NOT NULL, `evt_enddate` date DEFAULT NULL, `evt_starttime` time DEFAULT NULL, `evt_endtime` time DEFAULT NULL, ...

How do I return data from multiple MySQL tables in date order?

I have another MySQL problem. Again, with the complex queries I'm in over my head. On my website I currently display the last 5 reviewed games on the main page. Now, it's been ticking over a while and I've decided to add news items as well to the same page. But, I want to change the system that I have into one that displays news entrie...

Setting up multiple MySQL databases with scalability options

I need to set up a MySQL environment that will support adding many unique databases over time (thousands, actually). I assume that at some point I will need to start adding MySQL servers, and would like my environment to be prepared for the case beforehand, to make the transition to a 2nd, 3rd, 100th server easy. And just to make it in...

How can I include break lines in mysql records?

When someone types in the following to be put into a database: Hello, My name is John and I am 22, and looking for a good time. My Phone Number is: 555-NOT-REAL Sincerely, John D. I want the break lines to stay there, but it seems that when I pull the value back out it comes out as follows. Hello, My name is John and I am 22, and ...

Confusing MySQL query

I have two tables, staff and phones. Staff has only one field, staff_id. Phones has three fields: staff_id, phone_type and number. I want to display the staff_id, cell phone number and home phone number of all staff members. But I can't figure out how to have cell phone number and home phone number as separate columns in the result. He...

MySQL query to handle encoded characters using Regular Expressions

My problem involves searching a MySQL table for a list of matching city names given an initial search string with the purpose of handling special characters such , etc that are encoded with an html entity (&ouml;). Example: There is a table called 'cities'. The column for the city name is called 'name'. There are two cities Hamberg (id...

Why is my MySQL INSERT query inserting 3 identical rows?

I am trying to track what users are searching for on my site (from a simple search form on the front page) with PHP and MySQL. At the end of all my queries I am using this query: INSERT INTO `DiggerActivity_Searches` ( `SearchTerms`, `SearchType`, `NumResults`, `Location`, `Date`, `Time` ) VALUES ( 'SearchKeywords', 'SearchTypes', 'Num...

Postgres or MySQL For Web Applications?

Duplicate: MySQL vs PostgreSQL for Web Applications Do you recommend PostgreSQL over MySQL? How different is PostgreSQL to MySQL? I've been toying with PostgreSQL for about a week, and, while I like it, I can't figure out what the specific advantages of PostrgreSQL over MySQL (using InnoDB) are. There seem to be a lot of features,...