Professional Hypertext Preprocessor, a widely used platform for dynamic web applications.

learn more… | top users | synonyms

1
vote
2answers
64 views

MYSQL joining 3 tables with left join

I have these tables: pupils: (id_pupil, name, surname, email, user, pass, level, class) incidents: (id_incidents, date, time, type_incident, comments, id_pupil, id_user, subject, id_trimester) ...
1
vote
2answers
218 views

multiple connections on MySQL database with no users on httpd

My database seems to have many open connections despite having no users on httpd. mysql> SHOW PROCESSLIST; ...
0
votes
2answers
64 views

Want to show last month highest scorer details grouped by week

I have a table of data: id | name | userid | score | date | -------------------------------------------------------- 1 | john | 4 | 233 | 2014-02-02 2 | ...
0
votes
2answers
54 views

MYSQL Master-Slave replication not working with PHP

My data gets replicated from the master database when I do it manually but when it gets inserted from PHP into the master database it doesn't get replicated to the slave database. My Master database ...
0
votes
2answers
51 views

Disk write in iotop when doing mysql “Copy to tmp table”

I have just moved servers from a two-server configuration with the application and database server running separately to a one-server LAMP stack. Unfortunately the issue that I have encountered on ...
0
votes
2answers
145 views

database structure - complicated requirements

I have a project to build a website but it's complicated and I'm having trouble figuring out what the best way to build the database would be to handle these particular requirements. The site is for ...
2
votes
1answer
1k views

Why does that query cause lock wait timeouts?

From time to time, I find a lot of these errors in my PHP error log: MYSQL.1213: Deadlock found when trying to get lock; try restarting transactionSQL The problem persists for about 2 or 3 minutes. ...
1
vote
1answer
52 views

MySQL 5.5 to 5.6 Upgrade. Will data remain the same?

We are considering to upgrade to MySQL 5.6 this summer. I would like to know if our data will be changed in any way once we perform the upgrade? I've been reading and I found that mysql_upgrade ...
1
vote
1answer
241 views

Calculating the median value in a MySQL table with CodeIgniter

This is my model file in codeigniter. I need to calculate the median for this variable: budget_breakdown.breakdown_grants. How can I do this calculation? function reports_details1() { ...
1
vote
1answer
121 views

Repeated values in group_concat

I have two tables, first the table food and Second is Activity: INSERT INTO food (`id`, `foodName`) VALUES (1, 'food1'), (2, 'food2'), (3, 'food3'), (4, 'food4'), (5, ...
0
votes
1answer
17 views

Insert a file into PostgreSQL BYTEA field using PHP

The previous answers have been horribly complex for the scope of this project. I want to take the $_POST result as a variable and insert it into a BYTEA field of a table. $_SESSION['username'] = ...
0
votes
1answer
31 views

MySQL - prevent OS cache for query

On high load production server I have many sql selects which are unique or re-use will be in hours. I use SQL_NO_CACHE but this queries are still cached with OS cache. Server have 64G ram and used ram ...
0
votes
1answer
40 views

Problem with intersection table

I seem to have came to a problem which I am having trouble solving, possibly because I have misunderstood intersections properly(or perhaps I shouldn't even use intersections for the goal). If we ...
0
votes
1answer
54 views

Automobile database logic

I am building a web based quoting system for a local automobile dealership. I think I have figured out the logic for the databases but I want to get a second opinion before I start just to make sure ...
0
votes
1answer
59 views

Mysql query in Database

How to get all the tables from database with all values in tables using single query.. I tried using $sql = "SHOW TABLES FROM $dbname"; $result = mysql_query($sql); $arrayCount = 0 while ($row = ...
0
votes
1answer
29 views

Server down after PDO connection

I don't know is this off-topic for this site but I have site that run on PHP and MySQL. And I want to change my MySQL connection to PDO. This is my connection file that I include in every file at the ...
0
votes
1answer
65 views

Saving LZW encoded data into a mySQL database

I send LZW compressed data from the client side with JavaScript to the server. The problem is that the data becomes corrupted after saving it to database. So my question is, what collation should I ...
0
votes
1answer
137 views

I need advice on these queries

could you help me optimize these queries? here are queries, please note that you see something like OR 1=1 OR those are values I pass via php and may change. query#1: SELECT posts.status, ...
0
votes
1answer
524 views

MySQL PDO Cannot assign requested address

Can someone help me with this error? [08-Apr-2013 17:44:08 Europe/Berlin] PHP Warning: PDO::__construct(): [2002] Cannot assign requested address (trying to connect via tcp://****:3306) in ...
0
votes
1answer
219 views

Mysql - Problem speed of access on query (Low latency query sometime)

My web application is real time site that need a speed of access on every query (SELECT, UPDATE, INSERT) that must less than 200ms Because one of my php script task is query (SELECT, UPDATE, INSERT) ...
-1
votes
1answer
57 views

MySQL: how to copy a database from one server to another without export / import

I have access on two different Windows systems. There is one MySQL database on one system which I want to copy to another system. Please note that I haven't username and password for DB access on the ...
-1
votes
1answer
50 views

Error in upgrade_from_array - mysql: 1064 query: DROP TABLE IF EXISTS filling tables

Error in upgrade_from_array - mysql: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myhandyrestaurant' ...
1
vote
0answers
45 views

mysql database is corrupt after system power failure

I have mysql database using xampp in my widows system. its got currupt after power failure i have back of database before 2 days but i dont have backup of one day transactions. now i tried ...
1
vote
0answers
33 views

mysql vs mongodb cache/load balancing

I have a system where users can 'like' content. There will likely be many hundreds of these likes going on at once. I'd like it to be AJAX driven so you get an immediate response. At the moment I ...
1
vote
0answers
164 views

What is the best way to manage user access to MySQL via PHP?

I am working on a web application that requires auditing db queries in MySQL. In every application that I have developed or worked on it is standard practice to store the DB credentials in a protected ...
1
vote
0answers
170 views

Need to search users by latitude and longitude

I'm still learning SQL and this is a bit more advanced than my capabilities, so I could use some help. I think I need a sub-query or something. In the database I have a table called user with a ...
1
vote
0answers
432 views

mysql remote connect

Having troubles with this and I'm not sure why.. I'm trying to access a mysql database from another server. I changed the my.cnf file (uncommented the bind-address to access from all): port=3306 ...
1
vote
0answers
173 views

big mysql database optimization

My Joomla mysql database has about 3.4 million rows in content table. It is just static article. Very slow and often use out of resources. To speed up it, I segmented it into 6 sub-tables and added ...
1
vote
0answers
235 views

MySQL GROUP BY and ORDER BY giving inconsistent results

I'm currently working with WordPress, and I've added a new meta value which is a number between 0 and 30. Zero is ignored and up to 30 need to be organised in order and only the latest (based on the ...
1
vote
0answers
799 views

SQL query optimization in Prestashop e-Commerce solution

I'm working on a layered navigation module within Prestashop e-Commerce solution. I'm trying to optimize a SQL query which creates a temp table during execution. I think this is creating a ...
0
votes
0answers
24 views

How to use Select query just right after Insert on master in a query.?

I have a question on mysql replication. As usual, I deployed my db structure like the Update on master db, the select on slave. My questions. If I use SELECT query just right after INSERT in a query, ...
0
votes
0answers
11 views

#2002 Cannot log in to the MySQL server / Connection for controluser as defined in your configuration failed

I use PHP/MySQL in Ubuntu 13. To reduce the size of ibdata1, i followed this post What is the best way to reduce the size of ibdata in mysql? and make necessary changes as told in the answer. I did ...
0
votes
0answers
24 views

mysql id sequencial problem

I create 3 records with the id 1,2,3 I delete record 3, then in the future add another record, it then goes 1,2,4. how to id get sequential order when it is deleted the record like 1,2,3
0
votes
0answers
25 views

Filemaker to Firebird data exchange

I want to connect from filemaker to a firebird 2.x DB. Firebird ODBC is not supported, only MYSQL, MS SQL etc. Is there any way to have a translator in between or maybe to connect through a PHP ...
0
votes
0answers
49 views

MySQL + PHP : avoid dirty read

It's possible to avoid dirty read on a MySql database by using a PHP script? i have three two fields (user, incoming_request , outcoming_request) on my table that keep information (as string) about ...
0
votes
0answers
92 views

INSERTS in a loop: Better to use NOW() for each row or PHP date() function once?

Consider a PHP application which inserts about 200-800 records in a loop via prepared queries and parametrized values. The PHP application is on Amazon Web Services, and the database server is in ...
0
votes
0answers
34 views

fulltext search on multiple tables with different fields

I am trying to make a search page return results from multiple table ordered by the keyword. The problem is the select statement gives a result sorted by the select statement and not by the keyword. ...
0
votes
0answers
273 views

Occasional disk I/O errors in SQLite

I have a very simple website running PHP and SQLite 3.7.9 (with PDO). After establishing the SQLite connection I immediately execute the following queries: PRAGMA busy_timeout=0; PRAGMA ...
0
votes
0answers
87 views

Data migration of specific data from one DB to another

I am new to this site, I have one major question of data migration, I apologize before hand if the question is too silly. I have two data base on one server, I have one table with the same schema on ...
0
votes
0answers
77 views

how to update current row value by selecting previous row value in php mysql

How can i update data of current row with selecting data of previous row in php mysql. I have tried following query but it showing me error. update sales_tracking set sales_tracking.opening_units = ( ...
0
votes
0answers
89 views

MySQL stops responding (at almost regular intervals)

Using mysqld (latest xampp version). My.ini port= 3306 socket = "D:/xampp/mysql/mysql.sock" basedir = "D:/xampp/mysql" tmpdir = "D:/xampp/tmp" datadir = "D:/xampp/mysql/data" pid_file = "mysql.pid" ...
0
votes
0answers
341 views

Update row to another table using mysql trigger

I have the following 2 tables (places & offer_company) in a MySQL database named COUPON1.81. CREATE TABLE IF NOT EXISTS `places` ( `id` int(60) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT ...
0
votes
0answers
69 views

Automated query log

I would like to ask for some opinions or recommendations or guidelines on how to create an automatic logging system for the executed querys on a MySQL database. Some details: its a php+mysql ...
0
votes
0answers
124 views

Query should yield result but doesn't

I need to get data from a remote SQL 2000 server and store it in a new MySQL server. I am using the FreeTSD module for php 5.3 to connect to the SQL 2000 server. I can connect without problems. ...
0
votes
0answers
22 views

packages that php need to connect to mysql

I want to know minimum packages that php need to connect to mysql? I know some packages such as php5-mysql, mysql-common, mysql-client,... Also I want to know a short description about architecture of ...
0
votes
0answers
215 views

Mysql 5.6 and install php5-mysql , mysql-common

I install Mysql 5.6 with this documentaion(in ubuntu 13.04) , now I need to install php5-mysql and mysql-common packages. can I install them with apt-get? I think they will install mysql5.5 ...
0
votes
0answers
78 views

Database Schema/Structure advice

Well i am reconstructing an already created application and was looking to improve this, especially with in the database structure. I want to start off with probably the biggest section and that is ...
0
votes
0answers
224 views

MySQL Left Join Select all rows

Hi guys I have a query which is pulling data from database : SELECT sandwich_table.id, `sandwich_name`, salad, COUNT(salad), salad_type.type, ...
0
votes
0answers
156 views

Try to find a match using SUBSTRING(SHA1(value)), 0, 6)

I have a tbl where all entries for companies that participate in a online project are saved. This table is named "business". Those companies can use their employess to access the online platform i 've ...
0
votes
0answers
553 views

Sqlsrv sqlsrv_num_rows FALSE, adding cursor type times out

$sql = "SELECT * FROM lastdeath"; $result = sqlsrv_query( $con, $sql); if( $result === false ) { die( print_r( sqlsrv_errors(), true)); } $row_count = sqlsrv_num_rows($result); echo $row_count; ...