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

learn more… | top users | synonyms

-1
votes
1answer
13 views

How can I create a church attendance report system?

Please am pretty new to php and mysql. I have an assignment to create a church attendance system for our weekly services. The system would be able to know how many males and females came to church ...
0
votes
1answer
4 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
1answer
15 views

MYSQL inner join , if not match try another table

I've got a very quick issue here, how can i join a table with two other tables in a way if one's info doesnt match, it goes try another one. something like: $properties = $mysqli->query("SELECT *...
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
1answer
17 views

How to make table with row name and column name

I am new to databases and now i came to a point where i need more complex table. I have a table which contains site details. Each site can have multiple devices. Each device have multiple measurement ...
-1
votes
1answer
40 views

Recovering a lost database [on hold]

Before I start, there might not be a way to do this but I thought I would ask anyway.. I built a php application with Laravel 5.2 and have suddenly noticed I have lost the MySQL database for the ...
-1
votes
0answers
12 views

how do we know if mysql server is overloaded [on hold]

I am developing an application using PHP. Sometimes Mysql is overloaded. Is there anyway I can tell the user the database is overloaded & to come back later?
0
votes
1answer
52 views

Reset MySQL table data after each session is completed in php

I am creating a PHP application demo. The users who login can insert, modify and delete data but when they logout the data must be reset to the default data I set before. The data must reset ...
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
18 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
1answer
30 views

Can't login to sql server custom db

I have wamp installed in my system and sql server 2014, and configure so i can access sql server db through php.. with this code: <?php $serverName = "MY-PC\sqlexpress"; $connectionInfo = array(...
0
votes
1answer
22 views

How to get list of dates between From Date and To Date in MySQL [closed]

I have a table Emp_UnAvailablity_ID`, `PersonID`, `Is_UnAvailable`, `From_Date`, `To_Date` FROM `emp_unavailablity. I want to get list of all dates between From_Date and To_Date. I have tried this ...
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 ...
1
vote
0answers
12 views

I cannot fetch the value of a mysql alias [migrated]

I have the following code: $query = " SELECT distance, outcodepostcodes.lat, outcodepostcodes.lng FROM ( SELECT $table.*, outcodepostcodes.lat, outcodepostcodes.lng , outcodepostcodes.lat*3 AS ...
-3
votes
0answers
18 views

date wise convert row to column with sum of amount in mysql

i want dynamic table for dynamic date wise with sum of amount....plz help me guys.. Thanks in advance
1
vote
0answers
16 views

log_bin_trust_function_creators deterministic always throws an error on server restart [duplicate]

Everytime my rackspace server restarts because of some maintenance or an outage, all of my mysql functions stop working due to this deterministic error. To fix this, I have to manually pull up the ...
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 ...
-1
votes
1answer
67 views

Server Specifications for Web Application [closed]

I am trying to select the configuration for a web application built in PHP 5.5 and MySQL 5.1. I will also be deploying PHPmyAdmin for the MySQL database. Both the web application and the database will ...
0
votes
2answers
25 views

Do dormant databases impact server performance?

On our web server, my team has been creating new databases in MySQL to manage backups. They simply create new database_DATE and copy over our live site. Which made me think today... Can having a ...
1
vote
2answers
140 views

Efficient workflow/queries to save unique information?

I am saving company information in a database. There is a single table with an auto-incrementing key that is unique to each company. There are separate tables for emails, websites, phone numbers, and ...
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 ...
1
vote
0answers
28 views

How to compare three columns on WHERE condition? [closed]

I need to compare three columns in a single table. Please help me clarify this problem. $pro_qry1 = "SELECT * FROM orders WHERE customer_id ='$id' AND item_id='$pro_id' AND status='0'"; $pro_run1 = ...
2
votes
1answer
112 views

Strange Garbage Character in SQL server database like ÂÃÂÃÂÃÂÃÂÃÂÃÂÃ [closed]

I am using HTMLBOX editor for getting Notes/RichText Data input from User. I found there are lot of garbage characters in my database and they keep on doubling on each time user save/update notes. ...
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
1answer
40 views

Mysql/pivot table for two tables

I was trying to get multiple rows into single row with dynamic columns created as per the data.i have two tables combined with foreign key.here is my data follows table 1: | id | name | Invoice value ...
-5
votes
1answer
59 views

Could someone explain how PHP, MySQL, SQL work together? [closed]

I feel so confused on what they are and how they work. From what I've read PHP is a server-side language. Therefore, it's a language basically designed to talk with the web server to get it to do ...
0
votes
1answer
63 views

Searching a text with space in mySql match against Query

I want to search a text in mysql DB with [space] (Ascii 32) as a part of it. But I am not getting the correct result. My MySql Query is: SELECT count(id) as total , MIN(product_price) as ...
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
2answers
47 views

Encrypting a Database row-by-row

I have a large database (millions of rows in hundreds of tables) that contains sensitive data (Think SSNs, account numbers, etc). I am tasked with safeguarding the data and have chosen to encrypt only ...
2
votes
1answer
55 views

Prevent duplicate entries

I have log in form with Username and Password. $con=mysqli_connect(LOGINDETAILS); /*if (!$con) { die("Can not connect: " . mysql_error()); } */ $Username = $_POST['Username']; $pswd = $_POST['pswd'...
0
votes
1answer
55 views

Database convert character_set_server latin1 to utf8

I am writing about a problem on the character encoding that i have on my site with Magento. In practice, the special characters do not take utf8 and gives me the classic non-coded characters: Ã. ...
-3
votes
1answer
14 views

Fetch data from three tables two tables have one same column [closed]

I have three tables a,b,c table a sender status type name1 approved one name1 approved one name1 approved two name2 pending one table b sender p_id name1 ...
0
votes
1answer
69 views

Slow search by LIKE and other values (1 million rows+)

I'm currently developing a kind of search website where one can search for business companies in my country. The database table has 1 million rows and quite a few colums (42 columns). But I find it ...
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
1answer
34 views

SUM 2 columns with 2 columns same name [closed]

I have this table id, teama, teamb, pointa, pointb. Columns teama and teamb containing the same names. I want to output the sum grouped by teama from teama where pointa and where teamb pointb. for ...
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
2answers
65 views

Insert the same time, it is possible to happen?

Good evening. I have a doubt about inclusion in the database. A common example is a user account where the user names must be unique. In the following logic: User enters data into a form. Data are ...
0
votes
2answers
60 views

Searching for a keyword across multiple columns

I have a set of names of schools stored in each row in my schools table. the same table has four different category columns which store the names of the subjects they offer. I want to enable ...
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 ...
2
votes
1answer
23 views

Inserting Items Bought by the Customer into the database

I'm having a hard time conceptualizing on how to store the items purchased by the customer into the database while taking note of who was in charge(the cashier in charge of the customer's products) of ...
2
votes
1answer
32 views

Removing the uses of MySQL temporary tables

We have a very huge PHP/MySQL application with a lot of legacy code, this application utilized MySQL for most of it's work. It does most of the processing on the database side using temporary tables, ...
0
votes
0answers
132 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
1answer
46 views

Connected to mysql database but cannot print the data

I connected successfully to my database and the I tried to print my data but I can only see the "Connected succesfully" line in the browser. Here is my code: <?php $db=@mysqli_connect("host","...
0
votes
1answer
32 views

Php, MySql - Optimisation

I asked this on the general site, but they suggested I come here for ultimate optimisation. It really boils down to which is faster; doing a load of calculations in php with database stuff that is ...
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
votes
1answer
21 views

How to sort student result based on subjects

I have this mysql table How can i sort this MYSQL table to this output:
0
votes
1answer
33 views

How to find the most common phrases in a MySQL database

I have a table which contains articles on movies. Each article has a title and many of them have common phrases in them. I would like to do some analysis on the data and extract these common phrases ...