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

learn more… | top users | synonyms

1
vote
1answer
67 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
175 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
618 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
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 ...
0
votes
0answers
42 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
14 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
76 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 1--------erik---------2--...
0
votes
1answer
132 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
53 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
300 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
33 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
61 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
387 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
73 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\...
0
votes
0answers
44 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
63 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
117 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
21 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
109 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
244 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
132 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
103 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
410 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 ...
1
vote
1answer
222 views

Best practice to create a database schema for Open Auth (Social logins)

I've done a database schema for user management alongs with their roles and permissions. The problem actually began, when I decide to integrate a multiple "Open Auths" such as Facebook Login, Google ...
1
vote
1answer
219 views

How to update a whole document in MongoDB using PHP?

I want to update my older entries through the PHP interface in MongoDB. First, I get data from the text fields and then store that into variables. Then I use those variables to update data in Mongodb. ...
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
votes
1answer
186 views

Pivot data - dynamic column names [duplicate]

I am trying to pivot data. The column names have to be dynamic based on the row values for subject_id column. Table Sid marks subject_id 101 20 3 101 25 2 101 60 1 104 22 3 104 ...
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
1answer
130 views

How to add DATETIME value for session user

I am maintaining two tables: Employee table consists of username and password(for logging in) log table consists of login and logout time for the session user With the click of a button, I should ...
0
votes
1answer
253 views

Can I split mysql the search results into two tables in php?

I have index tables with multiple columns: s | s1 | s2 | s3 | s4 | s5 | s6 | s7 | s8 | s9 | s10 | s11 | s12 | ------------------------------------------------------------------- 0 | 1 | 0 | 1 | 1 ...
1
vote
1answer
371 views

MYSQL - Timeclock Count Hours In/Out for each day of current week

Below is my table for my database timeclock that records each record of an employee clocking in/out. I am wanting to create a function that returns hours for each day Monday-Sunday of current week. ...
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 ...
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
2answers
111 views

How can i get list of postgresql database through php or using just sql query? [duplicate]

What i want to do is to make a drop down list of all the databases of my postgresql 9.3 server using php . if i can get just the sql script that can do the trick then i can handle the php part. ...
0
votes
1answer
316 views

How to use explode mysql function in where condition with cakephp

I am using cakephp 2.6. I have payment_method fields in mysql table which store the values like 54,52,59,57 . Now my question is that how can i check if new posted payment method id is available in ...
0
votes
1answer
28 views

Where are tempory tables or record sets located?

Using mysql and php, I would like to understand where temporary results are stored. For instance, when I do a query that returns a set of data for processing by php, is the connection to the database ...
1
vote
1answer
121 views

MySQL Enterprise Connector/PHP Plugin for php 5.4 [closed]

I'm trying to setup mysqlenterprise.so. I have installed the native driver and loaded before mysqlent, but when I try to start it I got: Starting php-fpm: [14-Jul-2015 14:27:40] NOTICE: PHP message: ...
1
vote
0answers
199 views

How to deal with large amounts of data - PHP [closed]

I'm currently making a postage website using php, laravel and phpmyadmin. I have a list on postcodes for different areas and each area will have a different price. E.g. Area 1 - England, Area 2 - ...
3
votes
1answer
137 views

Skip specific field name

I am trying to execute a table from a MySQL database using a for loop statement, in order to get the field names as the column header. Here is my code: $result = mysql_query("SELECT * FROM ...
-2
votes
1answer
87 views

Is a normalized MYSQL DB faster than one organized with comma strings?

I've always used databases with comma-separated id strings, something like +------+--------------+ | id | users | +------+--------------+ |1 |2,4,5,6,12 | +------+--------------+ ...
3
votes
2answers
84 views

Missing DB entries

I have run into a problematic situation. I oversee the administration of 5 php web pages on one server, each having their own database. All pages work like interactive forms drawing and storing data ...
1
vote
1answer
1k views

No connection could be made because the target machine actively refused it. MYSQL work bench?

I have created php and Mysql site.Its Working Locally Xampp well. Finally I moved My site to server..i have Used Mysql Workbench. connected client database in Mysql Workbench in My system.when I Run ...
2
votes
1answer
615 views

DB Schema for Timesheet

Hi I want to create a web based resource tracking system which will be used by my manager using php and html. The db i am using is MySql. I have already created tables for employee, project etc. I ...
2
votes
3answers
93 views

How to show multiple names for one record but not duplicate the record?

I have a database structure like so: Car - id - carname - image - category - status Parts - partid - partname CarParts - carpartid - carid(fk) - partid(fk) - amountid(fk) Category - ...
0
votes
2answers
2k views

No connection could be made because the target machine actively refused it

I have created a PHP site using MySQL. It works well on localhost. However, when I moved it to a remote server, it stopped working. The error shown is: "No connection could be made because the ...
1
vote
2answers
285 views

MySQL “case as column” question in WHERE clause

I'm setting up a new column with this case statement: SELECT * , CASE t2.field_max_occupancy_value WHEN 'one' THEN 1 WHEN 'two' THEN 2 WHEN 'three' THEN 3 WHEN 'four' THEN 4 WHEN 'five' ...