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

learn more… | top users | synonyms

2
votes
0answers
70 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 ...
0
votes
0answers
42 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 ...
1
vote
1answer
27 views

SELECT with equal chance between same IDs - MySQL

How can I SELECT data with equal chances for same IDs in MySQL (for php). For example, assume below data structure: id value 1 alfa 1 beta 1 gamma 2 hello 2 bye 3 sky I want ...
0
votes
0answers
84 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
2answers
27 views

Migrating Pure PHP Site with Associated Database To New Server

First, let me say I'm not a DBA or network admin, but have moved large scale CMS websites from host to host. But, I have never moved a pure php coded database driven website from one host to another. ...
1
vote
2answers
36 views

How to subtract an object from another in PHP/MySQL?

I am printing totalbooks with this code: $query ="select sum(copies) as totalbooks from booksdetail"; $result=mysqli_query($con, $query); while($row=mysqli_fetch_array($result)){ echo ...
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
1answer
637 views

Load csv file to mysql using load data local infile

I need a simple way to load a csv file from my computer to the database (which is on a remote server). I'm trying to load the file using a php page that executes this code: $file = ...
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. ...
1
vote
1answer
37 views

Multiple increments in table

Let's say I have a table which stores different bills. There are multiple departments using this database and every department needs to use their own incremental numbering for the bills. I do ...
0
votes
1answer
230 views

PhpMyAdmin Import Error-MySQL server has gone away/Unrecognized Keyword

So I've exported a MySQL database from PHPMyAdmin (which I access from within IIS Express on a Windows 8 machine) and I'm trying to import this database onto another machine, however on that machine I ...
2
votes
1answer
209 views

Challenging MySQL query, compare two records to find if they match or not

I have a large (88K rows) table that holds data in pairs. For a specific entity, there are 2 records, with UID's and then a load of additional data. I need to take each pair (pairs can be found by ...
1
vote
1answer
229 views

How does mysqldbcopy function

I have a database called LIVE and I want to create a scenario were I copy the LIVE database every night at 2:30 am. I want the copied database to be called REPORT. So every night I want the REPORT ...
0
votes
1answer
86 views

MySQL shows previously deleted data

We're running MySQL on Azure. We have three very small databases. The main database is POI and it hold 11 static records. During the day a few records may be added and deleted again within 1-2 hours. ...
0
votes
0answers
80 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 ...
1
vote
2answers
219 views

How can I make an automatic copy of a MySQL database to another MySQL database on the same server?

I have two MySQL databases called LIVE and REPORTS on the same server. I want to copy the LIVE database and all its contents into the REPORTS database everyday at a specific time frame between 1 am ...
0
votes
1answer
129 views

Error code 1064 when trying to add anything manually

So i tried adding via php and i noticed i got a error , so i went into phpmyadmin and tried adding it manually by clicking the SQL in phpmyadmin and write in INSERT INTO `test`(`IDtest`, ...
0
votes
1answer
40 views

table design for display content

In my previous work station, I saw them have a table design across all website they have worked on displaying editor content like this: column|page_id| title |content_1|... |content_n| lang ...
0
votes
1answer
48 views

Update database table

I'm developing a website using PHP. I have a MySQL database and it has three columns called name, latitude and longitude. It is as follows. Name | latitude | longitude ---------------------------- ...
0
votes
0answers
116 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
70 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
20 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 ...
1
vote
1answer
61 views

Entering multiple entries in SQL where the count increases by one

I do apologize for the uninspired title, I'm not sure how best to put it. Another person helped me massively in another question I posted regarding the structuring of data. The solution has left me ...
1
vote
0answers
142 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 ...
2
votes
2answers
463 views

MySQL search comma separated keywords

I have keywords column in my table and there are comma (,) separated values. example: hello, world I have search engine with same codes: $search = $_GET ['search']; $query = $db->prepare("SELECT ...
0
votes
0answers
23 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 ...
0
votes
0answers
34 views

What is the fastest way to do a REGEXP find and Replace in MySQL database?

I have a table with 700,000 entries and I need to check each entry for 1,000,000 words and then replace the word if found from hello to #~hello~#. Words can occur multiple times in an entry and need ...
0
votes
0answers
13 views

Checking user right

Table's structure: id------username-----password------status 1---------derek--------123---------admin 2----------rob---------321---------worker I finished simple login page and its working. On the ...
0
votes
0answers
59 views

How to selecting data from two queries using union?

I have three tables. I am trying to taking the data with two times interval after then subtracting from first two second for every possible row and getting the ledger report. Solution is given by: ...
0
votes
1answer
73 views

Query distinct then select option then choose and query choosed as html result on page

Structure of database "diary": id------user_name-----day-----month------post 1--------erik-------- 3--------dec-------something 1--------erik---------3--------dec-------12345 ...
0
votes
1answer
110 views

Moving data from one table (a million records in it) data to another table which in remote location? (MySQL)

I want to move data from one table which have more than 2 million records in size into another table which is in a remote machine, and that moving should support Logging Restart Exception handling ...
0
votes
1answer
48 views

Select distinct then calculate a number

Structure of table: user-----headline----day----number 1 -----lotr -----1 ----- 2 1 -----lotr -----1 ----- 2 1 -----cpo -----2 ----- 2 1 -----cpo -----3 ----- 6 2 ...
1
vote
2answers
235 views

Selecting random rows from database initially while preserving that order later

I am building a quiz app, in which the student can login and can select the option of give exam. I want to show multiple choice questions to students randomly. I stored all the questions in one ...
1
vote
1answer
32 views

Which join to use

So I have a database I'm trying to convert to a new one, it has around 40k rows in let's call it table A, now the actual data is in table B which has over 1.6 mil rows. When I'm writing my PHP script ...
2
votes
1answer
60 views

Storing undetermined amounts of user information (MySQL)

I've been looking into the best way of storing an undetermined amount of information submitted by a user. A friend of mine suggested using nested tables, however these don't appear to be a thing in ...
1
vote
2answers
308 views

Insert into specific table if the user session group

I am trying to insert data into specific table by user session and group. The tables are users, workers, help. Structure of table "users": id | username | password | group ...
1
vote
0answers
67 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 ...
0
votes
0answers
43 views

Create a mysql database with scheduled queries

I want to create a system where a database only returns the most recent select query every 20ms,and otherwise returns the most recent one in memory. I am not sure how this can be achieved. I am using ...
1
vote
1answer
60 views

Optimization of complicated sums and counts in related tables

I have a categories table, which have two columns, id and name. I have a types table, which have three columns, id, category_id and points. I have a products table, which have three columns, id, ...
0
votes
1answer
84 views

SQLAnywhere : Installation PHP extension - variable LD_LIBRARY_PATH not detected by extension

I'm trying to install the SQLAnywhere php extension to connect my website on a distant Sybase database. But I can't declare the LD_LIBRARY_PATH variable which isn't detected by the extension. A ...
1
vote
1answer
20 views

Do queries called from within a transaction but found within another method act the same?

Imagine the following code: class foo { public function bar() { // Start the transaction $transaction = $this->db->beginTransaction(); try { ...
0
votes
0answers
31 views

Loop gets terminated in case of many SQL Insert Commands

I am executing SQL Insert commands inside a loop that runs for 1000+ iterations. The loop gets aborted without any error/exception in between after executing 700+ inserts. If I comment the DB ...
0
votes
0answers
38 views

Create user to view part of data only

I would like to be able to create new users so that they can view part of the data in a table I defined without having to create a new table and pull the data for them every time. Let's say I need to ...
2
votes
1answer
54 views

select from database with special characters

I am using php select * from `outstanding` where `lcocode`='PN007\00128' select * from `outstanding` where `lcocode` LIKE 'PN007\00128' kindly suggest code for fetching data with backslash I used ...
0
votes
1answer
91 views

MySQL DB Replication

Okay so here's my scenario. I have two applications that share some tables from the same DB. Let's call them App1 and App2. Lets also assume the DB used here is called DB1. App1 and App2. App1 is on ...
0
votes
1answer
201 views

Database-design for a small filter / search tag function

I'm building a search function in php for a database with 1k to 4k articles. It's going to be built on a tag system. I've been reading some tutorials, blog posts, q&a etc about it. Most important ...
0
votes
3answers
109 views

How do I echo data from two tables that are associated to one user in php

Say I have tbl_company with these cid------- cons_no-------- company_name ------- phone ------ address 1---------- q1----------------aple------------------------22222-------newyork 2 ...
1
vote
1answer
96 views

Same SQL stall on server but work on local ( on slower machine )

I have this strange issue that because of my limited knowledge about Mysql I cannot understand, I will really appreciate if somebody can enlighten me and point me to how to debug the issue. ...
1
vote
1answer
374 views

compare results between two select queries mysql

i'm making test application where users will input their select queries in input box and the application have to compare them if they are identical with "correct answer" query. "Correct answer" query ...