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

learn more… | top users | synonyms

3
votes
0answers
106 views

Inputting auto-incrementing, grouped, unique hashes?

Alright, here's what I've come up with so far: SET @id=(SELECT IFNULL(MAX(id) + 1, 0) FROM leads); UPDATE leads SET id=@id WHERE id IN ( SELECT id FROM (SELECT * FROM leads) AS something WHERE ...
3
votes
0answers
80 views

Is this user-storage database system efficient, effective and secure?

I am using: PHP Version 5.2.17-MIT-BACKPORT-GnuTLS SQLite 2.8.17 I have a database called users, which currently has a table called root. There will be others, once I get all the rows for root ...
2
votes
0answers
79 views

MySQL high performance difference between two similar databases

I'm currently upgrading from TecDoc 2015 Quarter 2 database to TecDoc 2015 Quarter 4 database. Q2 Database: 240,838,107 rows InnoDB utf8_general_ci 23.2 GiB Q4 Database: 265,508,380 rows ...
2
votes
0answers
44 views

selecting data from joomla back end mysql

I have developed a front-end that call a php server side service that adresses the mysql. On my local everything works perfectly, but on distant 1and1 machine, it only works for tables created by ...
2
votes
0answers
45 views

Caching impression counts to avoid mysql inserts

We currently get a lot of mySQL inserts/updates on duplicate daily (millions) and we're looking at speeding up the application by using some form of counter with memcached and then clearing it on ...
2
votes
0answers
376 views

Sync a local MySQL database and a live server MySQL database

I want to store data in my local MySQL database and after a time interval or when system connected to internet it will update my live MySQL database remotely. Is it possible? I have an inventory ...
2
votes
0answers
100 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 ...
2
votes
0answers
1k 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 ...
1
vote
0answers
55 views

use IFNULL in laravel

I have a query in laravel which is working fine. $subjects = $app->db->table('subjects')->LeftJoin('downloads', 'subjects.subjectID', '=', 'downloads.subject_id') ->where('...
1
vote
0answers
37 views

implement geo / spatial / proximity search with php and mysql — what have you done successfully

For my website's users, I want to implement a worldwide geo / spatial / proximity search with php and mysql. I want to do this as simply and minimally as possible. What is the minimum data I should ...
1
vote
0answers
172 views

PostgreSQL 9.4 - Allow access from PHP

I would like to configure PostgreSQL 9.4 to allow connections from database users with passwords from PHP on both the command line and through Apache on a CentOS 6.6 box. I installed PostgreSQL with ...
1
vote
0answers
72 views

How to import Sqlite database into another Sqlite database?

Hello everyone I am developing Desktop Application and using the WebSql Database this database is created into this path: C:\Users\Admin\AppData\Local\Google\Chrome\User Data\Default\databases\...
1
vote
0answers
63 views

insertion creates duplicate with same data

I am using MySQL with PHP. I fetch data from a third party using SOAP. I have an issue with duplicate insertion of data. This occurs once or twice a day. Say there are 10 records ready to enter into ...
1
vote
0answers
30 views

Caching impression counts to avoid mysql inserts

We currently get a LOT of mySQL inserts/updates on duplicate daily (millions) and we're looking at speeding up the application by using some form of counter with memcached and then clearing it on ...
1
vote
0answers
167 views

How to send MySQL query results to outfile and standard output at the same time?

I "normally" query MySQL with SELECT col1, col2 FROM tablename LIMIT 10; and sometimes instead send the output to a file with SELECT col1, col2 FROM tablename LIMIT 10 INTO OUTFILE '/path/to/...
1
vote
0answers
332 views

Best way to approach building search functionality using PHP on existing mySQL Database

I am looking for advice on how to approach an upcoming project I am due to undertake. The reason I am asking is that I'm just out of college and the company I work for is currently searching for a new ...
1
vote
0answers
157 views

Question on MySQL insert race condition

I'm using MySQL 5.1, PHP 5.3 and the table is MyISAM. Here's the DTD of this very fake table: CREATE TABLE `temp1` ( `value` varchar(10) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 This ...
1
vote
0answers
414 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
463 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
499 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 compatible,...
1
vote
0answers
1k 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
570 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, sandwich_type_table....
1
vote
0answers
381 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
387 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 ...
0
votes
0answers
2 views

What's the advantage of the inet datatype in Cassandra vs a plain text string?

What is the inet datatype really for? The documentation refers to its usage having something to do with Python but I'm not much of a Python guy so that aspect is beyond me. Is there any advantage to ...
0
votes
0answers
13 views

Calculate class average where students offers different number of subjects

Please guys help me get the exact class average of a class. In this case the students in the class are offering different number of subjects, so a student in the same class can be offering 8 subject ...
0
votes
0answers
9 views

Moved MySQL server, new entries have wrong timestamp

Setup: Linux (Ubuntu 14.04) + MySQL Server 5.6 I've got a site where the website and MySQL server were running on the same machine, located in France. Now, I've gone ahead and moved the website and ...
0
votes
0answers
4 views

invalid db driver in sql server codeigniter

At first when I don't have any codes in my models and controllers and views it does'nt show up until i run it with my codes This is my code: $db['default'] = array( 'dsn' => '', '...
0
votes
0answers
17 views

PDO, create temporary table and select seem not to behave as expected

From a php cli script, I'm trying to create a temporary table and populatie it if it does not already exists. This works but is not optimised. By design, this script may try to execute the MySQL ...
0
votes
0answers
17 views

update data to table from another table and avoiding null values

i have two tables in mysql. Tbl1 - has product_id and tax_id fields. Tbl2 - has product_id and tax_id_w fields. Tbl1 needs to be updated (only values for tax_id field) from Tbl2 values of tax_id_w ...
0
votes
0answers
23 views

php mysql insert time

I am getting time values from another application in this sample format "2016-12-25 13:43:15" but when they get to my database they change to "0000-00-00 00:00:00" for the date am using DATETIME mysql ...
0
votes
0answers
17 views

find unique value from a list & sum & count their existing required value

1) I have a table named "plan_info_upload" which is like: site_id site_name 2G_bw 3G_bw route_path 1 MBCGP1 11 30 MBLMA1>MBSMGR 2 BOPBG2 12 22 ...
0
votes
0answers
33 views

Updating rows in multiple different tables using JOIN

Following is my MySQL SELECT query and it works. SELECT candidates.CandidateName, candidates.CandidateVotes, candidates.Party, candidates.win, candidates.NameOrder, ...
0
votes
0answers
27 views

Two -way replication on the same server

I have an ubuntu server, and I have a mysql with two database. I want to sync these two database (Two way replication) either via php or command line. I have searched a lot, but I cant find something. ...
0
votes
0answers
14 views

Database design advice for user access to certain options

I'm creating simple management system where I have 4 types of user access i.e. different permissions. I have created table users where I store each user and each user has user_role column where I ...
0
votes
0answers
7 views

PDO does not fetch any results

I was using PDO queries directly in index.php file.Now I want to create separate file where I will store functions. I created one, but when I call function returns only "0". Old version works: $...
0
votes
0answers
38 views

PHP+MySQL error HY000/2002: buffer memory insufficient or query queue full

I'm developing a small project in PHP(mysqli)+MySQL using only prepared statements. I've got a table related to 4 other tables in 1...n cardinality. I wrote a script with a simple for loop from 1 to ...
0
votes
0answers
29 views

MySQL user variables vs repeated parameter literals. - performance

I am currently designing a large query which uses a number of parameters numerous times throughout the query and subqueries. After checking out some posts on multiple repeated params, I decided to ...
0
votes
0answers
131 views

MySQL Too Many Connections (Max Connections Limit Not Reached)

Running a PHP 5.6 application that connects via MySQLi to a MySQL database (5.5) that intermittently errors with the "Too many connections error" however this seems to be a red herring to another ...
0
votes
0answers
18 views

Sum data from 3 tables(joining), but one of may no data then other tables data will show

I am making a stock group summary report for this I am making Sum data from 3 joining tables, but one of may no data then other tables data will show. I have 3 tables as: ac_stock_item, ...
0
votes
0answers
67 views

Error on connecting to mysqli

I have a virtual server that I'm running MySQL Server on that and Operation System is Windows Server 2012. from my own System I mean home PC , easily I can connect remotely to MySQL Server without ...
0
votes
0answers
105 views

SET FOREIGN_KEY_CHECKS=1; Commands out of sync; you can't run this command now

I am getting errors that I do not know how to solve using MySQL and php. The error is this... SET FOREIGN_KEY_CHECKS=1; Commands out of sync; you can't run this command now I am trying to run the ...
0
votes
0answers
30 views

Auto Insert new entry's in different database

I have 2 websites with similar MySQL database and both on same server (Linux) When a user register on website A I want to copy the user data to website B database (adb.users to bdb.users). Is there a ...
0
votes
0answers
10 views

MySQL - Remote Connections - In what format are credentials sent across the internet

Situation I have 3 MySQL servers on 3 machines. Sometimes they have to interact with each other which requires a remote connection from one machine to the other, usually via a PHP PDO connection. ...
0
votes
0answers
91 views

MySQL how do I select consecutive rows on table and back to start at end of table?

I have a little website (actually in dev stage) to manage race standings for a game. I have a table "race" with 19 rows representing 19 grand prix. I have made a page where I show 5 grand prix based ...
0
votes
0answers
134 views

Slow response from mysql and web application

We have a Mysql server and apache running on ubuntu via VMWare. Server has 2 CPU cores and 4GB allocated to it. On the server is a web app via php cake framework. One of our developers noticed we had ...
0
votes
0answers
40 views

SQL Schema - Messed up my schema and want to revert

I was playing around a bit with my database.table schema (keys) and I have now messed it up. This is the original schema: CREATE TABLE IF NOT EXISTS `xeon_stats_clicks` ( `id` int(11) unsigned NOT ...
0
votes
0answers
79 views

MySQL Match … Against query very slow

I work on a website running on Propel ORM and I have this query: if(isset($args["QueryText"]) && $args["QueryText"] != "") { $query = $query ->withColumn("(MATCH (Request.Subject, ...
0
votes
0answers
21 views

Sphinx result set error?

I'm getting below error when using sphinx search, selectmylikesfrom tableindex,tablert; ERROR 1064 (42000): INTERNAL ERROR: the column 'mylikes/mylikes' does not present in result set schema ...
0
votes
0answers
24 views

How to get data from join only if all the services are available

I have created a service table that contains list of all services available with a vendor. For example suppose my vendor is a salon and it provides services like hair cut, massage, waxing, threading ...