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

learn more… | top users | synonyms

-2
votes
0answers
45 views

How to use multiple conditions using AND and OR in WHERE statement? [on hold]

how can I apply a multiple conditions in my WHERE clause using AND and OR? What is the best way to apply this? My scenario looks something like this. ...
0
votes
0answers
22 views

How to populate values in drop down list in php postgresql [migrated]

I am getting error while populating the values in drop down list using php postgresql. Error means no output in drop down list. Below is my code. <!DOCTYPE html> <html> <body> ...
0
votes
2answers
189 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 ...
-2
votes
2answers
28 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
192 views

How to check mysql password change and other events logs

Recently someone change my phpmyadmin password and drop database I think it was sql injecting. Now I want to find information about this like when, how and who change my password Please tell me ...
1
vote
0answers
21 views

MySQL/Eloquent belongsToMany relation - two tables same pivot table allowed? [migrated]

Is it allowed to have two tables, each with a belongsToMany() relation to each other, using the same pivot table? Here is my User table: And here is my Org table: And here is the pivot table: ...
0
votes
1answer
20 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 ...
1
vote
0answers
15 views

Can I install php 5.6.10 and mysql 5.6 in flash drive [migrated]

I want to use the latest version of Apache PHP and MySQL in flash drive And then I'll use it for any computer
0
votes
1answer
235 views

Quickly establishing if a remote MySQL connection is valid using PHP

I have a hosted website (Namecheap Pro shared hosting) that connects to a remote MySQL database using a read-only user privilege. This remote DB is updated by a separate system. The website works ...
0
votes
1answer
212 views

MySQL: SELECT GET_LOCK slow/timeout

I am using "Zebra Session" as a replacement for PHP's built-in session management. Zebra Session stores sessions in a MySQL database, and uses "session locking" in order to ensure that data is ...
0
votes
1answer
25 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 ...
0
votes
1answer
2k 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 ...
1
vote
1answer
294 views

Update table from calculated temporary table

I have two tables, one containing a set of user ID's, vote direction (-1 or 1) and ID of the object they voted on (casted votes table). In the other table, the object id, upvotes, downvotes and ...
0
votes
0answers
11 views

Spreading out iops use at Aws

Is there a way to store event info, such as those triggered by a listened to Dom event, and feed that info into a database at a specific rate? Using Aws databases usually means provisioning a set ...
1
vote
1answer
43 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: ...
0
votes
2answers
285 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 ...
1
vote
0answers
25 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 - ...
0
votes
1answer
210 views

Insert GEOMFROMTEXT (lat lng)

I am stuck, Please help. "INSERT INTO `routeplans` ( `polygon` ) VALUES ( GEOMFROMTEXT( 'POLYGON( (39.593254951279626 -119.2415714263916, 39.596231192849004 -119.2441463470459, ...
3
votes
1answer
62 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 ...
1
vote
2answers
221 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) ...
3
votes
2answers
70 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 ...
2
votes
1answer
564 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() { ...
-2
votes
1answer
44 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 | +------+--------------+ ...
1
vote
1answer
124 views

Reviewing relational database tables

I am building a database, but I am a little bit confused with my table relationships. I wish someone could help review my table relationships below for me and tell me where I am going wrong. I have ...
0
votes
1answer
148 views

MySQL taking significantly longer to query via PHP than CLI

TL;DR: I have a query that takes under a second to run via MySQL's CLI, but over 12 minutes via PHP and I'm at a total loss on what to check next. It's a fairly horrid query, full of joins, but the ...
1
vote
1answer
36 views

Hostgator php code error while creating a new database table

Error is Error creating database: Access denied for user ''@'localhost' to database 'my_db' Code is { <?php $link=mysql_connect ("localhost", "cpuser_dbuser", "password") or die ('I cannot ...
2
votes
4answers
2k views

How to subtract fields and insert the value in other field automatically?

id val1 val2 total 1 10 4 10-4(automatically get the value) . . . . I am using php and mysql. I have a total column I need to make calculation automatically in a field, how it ...
0
votes
2answers
151 views

Mysql connect without username/password

I build a new website for a client (WordPress is underlying) and have access trough FTP to his webspace. He does not provide or even know more informations than this because he had taken it from an ...
1
vote
4answers
1k views

is it possible to create a dynamic website without a database?(Only use a File to save Data)

I learn PHP from now. And for create a dynamic website usually use PHP + MYSQL(For database). In PHP have function like fopen() to create, write result from form to a file like txt or other. My ...
1
vote
0answers
26 views

Help with PHP code, SELECT from database [migrated]

<?php session_start(); include ('connection.php');?> <?php $username='pablorex192'; $consulta=mysql_query("SELECT question FROM users WHERE user = $username") or die ('This is the error: ...
0
votes
1answer
96 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 ...
0
votes
1answer
4k views

how to sync local mysql database and live server database?

My plan is to store data in my local MySQL database and after a time interval it will update my live MySQL database remotely. Is it possible? I'm planing a inventory management script in PHP MySQL. ...
2
votes
1answer
45 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
50 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
89 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
37 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' ...
-1
votes
2answers
38 views

SQL: Find row number with column entry of a specific string [closed]

I'm have an MS SQL Server 2014 Express database which I can search using a PHP script on my server to find if a string exists in the database. My SQL code is: IF EXISTS (SELECT * FROM TABLE WHERE ...
-3
votes
1answer
181 views

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

On my local WAMP stack things are working perfectly. When I upload the database on GOdaddy.com, this error shows up. Warning: mysqli_connect(): (HY000/1045): Access denied for user ...
1
vote
2answers
521 views

MongoDB/MySQL - auto increment vs object ID

I am in the process of evaluating MongoDB and writing some basic PHP applications around it. Typically in my PHP/MySQL applications, I would create an ID field and set it to auto-increment on each row ...
0
votes
0answers
54 views

How to make search faster using LIKE in mysql with over 3m row?

I looking for a solution to solve this. Any idea help me plz? My table over 3m record Data in search column like '0123456789' => cannot use Full Text Search. I try put innodb_buffer_pool higher ...
-1
votes
3answers
54 views

Query to return zero entries with COUNT

I have a problem with one task. I need to display various information through two diferent queries.(or one if it could be possible) The table has these fields. Location is set to x ...
1
vote
2answers
8k views

Connect Error (2054) - mysql_old_password issue still not solved

i use php 5.4.3 and i want to connect to a MySQL DB remotely (php script resides on a different server than the db) with normal oop way: $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME); ...
0
votes
1answer
20 views

Unknown column 'sitename' in 'where clause' [closed]

public function getSiteValues($value) { $this->db->select( 'site', 'id, option_name, option_value', NULL, 'option_name=' . $value ); // database, what ...
0
votes
0answers
86 views

How to make search faster in mysql DB with > 2m records, only numbers

I have a table with sim card data with over 2m-3m records. The design is a column sim_number = varchar(11) with data like number (0123456891) When the table is under 1m records it's still fast but ...
1
vote
1answer
29 views

Finding same values and updating rankings

thank you for taking the time to look at this. I have a simple table that I am trying to update based on the entries. table name is TOPUSER and there us a field called tu_total and tu_rank, I would ...
0
votes
3answers
31 views

Alternating usernames while connecting to mysql database

My server has a max_connections value of 400 and a max_user_connections of 250. Since I am always connecting with the same user name, my effective max_connections is 250 instead of 400. To solve this, ...
5
votes
1answer
23k views

How to get rid of “maximum user connections” error ?

I am using MySQLi for my webapp but whenever I want to visit some particular page, I get mysqli_connect() [function.mysqli-connect]: (42000/1203): User ***_user already has more than ...
1
vote
0answers
1k views

Sqlsrv sqlsrv_num_rows FALSE, adding cursor type times out [closed]

$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; ...
0
votes
0answers
36 views

making everything varchar on purpose, though some fields should be int

I'm writing a PHP website for some clients which parses excel, stores the value in a database and then retrieves them. Some fields are only integers, but the clients can't make up their minds, they ...
0
votes
0answers
40 views

Post categories model for a user submission wedbsite

I'm building an user submission site where users can make posts to content_types: Blog, Movies, Photos, Forums. Since these content types only have slight variances I would like to keep them in one ...