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

learn more… | top users | synonyms

0
votes
0answers
24 views

How to use Select query just right after Insert on master in a query.?

I have a question on mysql replication. As usual, I deployed my db structure like the Update on master db, the select on slave. My questions. If I use SELECT query just right after INSERT in a query, ...
0
votes
1answer
18 views

Insert a file into PostgreSQL BYTEA field using PHP

The previous answers have been horribly complex for the scope of this project. I want to take the $_POST result as a variable and insert it into a BYTEA field of a table. $_SESSION['username'] = ...
1
vote
1answer
16 views

Duplicate Data from two column

i have a table which has only two column one is pid(Photo ID) and another one is tid(Tag ID) +-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
0answers
14 views

#2002 Cannot log in to the MySQL server / Connection for controluser as defined in your configuration failed

I use PHP/MySQL in Ubuntu 13. To reduce the size of ibdata1, i followed this post What is the best way to reduce the size of ibdata in mysql? and make necessary changes as told in the answer. I did ...
0
votes
1answer
31 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 ...
1
vote
1answer
17 views

Adding ID in second Table

I have two table one is photos and another one is photo_detail, this is how i have created both tables: /* creating photos table */ CREATE TABLE photos( -> pid INT(10) NOT NULL AUTO_INCREMENT, ...
1
vote
0answers
28 views

Script to query MongoDB with PHP [closed]

With Code Igniter and MySQL I do: $this->database->query('select * from table'); But I don't know how to use MongoDB. Can I still use this the same way to query MongoDB? ...
0
votes
2answers
65 views

Want to show last month highest scorer details grouped by week

I have a table of data: id | name | userid | score | date | -------------------------------------------------------- 1 | john | 4 | 233 | 2014-02-02 2 | ...
0
votes
0answers
24 views

mysql id sequencial problem

I create 3 records with the id 1,2,3 I delete record 3, then in the future add another record, it then goes 1,2,4. how to id get sequential order when it is deleted the record like 1,2,3
1
vote
1answer
53 views

MySQL 5.5 to 5.6 Upgrade. Will data remain the same?

We are considering to upgrade to MySQL 5.6 this summer. I would like to know if our data will be changed in any way once we perform the upgrade? I've been reading and I found that mysql_upgrade ...
2
votes
1answer
129 views

What is the difference between MySQL and PostgreSQL in terms of writing SQL queries? [closed]

Other than performance and security is there really any difference between MySQL and Postgres like SQL queries, built-in functions, procedures and so on? I'm asking this because I'm familiar with PHP ...
0
votes
1answer
15 views

Force number of entries

My title probably isn't the best, but essentially I have a table that stores a host, vulnerability finding reference, and status. I am trying to query on those, but where I don't have an entry I want ...
0
votes
2answers
37 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 ...
7
votes
1answer
102 views

Deleting large amounts (4 million rows) of mysql data efficiently, on a very regular basis

We have a mysql table that at any given time has about 12 million rows. We need to delete old data to keep the size of the table somewhat manageable. Right now we are running this query daily, at ...
1
vote
1answer
57 views

Lookup table naming convention? [closed]

Is there a naming convention for lookup tables? I cannot see any declaration by oracle or anything consistent on google. However I assume some of you professional DBAs follow a convention? Perhaps ...
0
votes
1answer
40 views

Problem with intersection table

I seem to have came to a problem which I am having trouble solving, possibly because I have misunderstood intersections properly(or perhaps I shouldn't even use intersections for the goal). If we ...
1
vote
2answers
66 views

Questions since MySQL Startup

Have a weird question / (bug?) here. Using PHP My Admin I installed via apt-get on Ubuntu 13.10 Versions are as follows: Server version: 5.5.35-0ubuntu0.13.10.2 - (Ubuntu) Apache/2.4.6 (Ubuntu) ...
0
votes
1answer
47 views

Maximum normalization

I have been studying the normal forms rules to guide me with database design and data storage, the problem I am having is that once I optimize for the first normal form (1NF), I figured I may well ...
0
votes
2answers
54 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
votes
1answer
61 views

MySQL: how to copy a database from one server to another without export / import

I have access on two different Windows systems. There is one MySQL database on one system which I want to copy to another system. Please note that I haven't username and password for DB access on the ...
0
votes
1answer
26 views

Storage of final entry values in read only table

I have two identical tables, one is for rows which are in a queue, and one is where I move my rows once they have been processed.(thousands of rows processed daily) In my jobs table, I store ids to ...
1
vote
0answers
45 views

mysql database is corrupt after system power failure

I have mysql database using xampp in my widows system. its got currupt after power failure i have back of database before 2 days but i dont have backup of one day transactions. now i tried ...
0
votes
1answer
38 views

How to add CYCLE to BIGSERIAL in phpPgAdmin

I'm trying to apply CYCLE to a BIGSERIAL in phpPgAdmin. I've seen how to do it with a query, but I'd much rather be able to do it from phpPgAdmin. Can this be done with phpPgAdmin? If so, how? If ...
0
votes
2answers
51 views

Disk write in iotop when doing mysql “Copy to tmp table”

I have just moved servers from a two-server configuration with the application and database server running separately to a one-server LAMP stack. Unfortunately the issue that I have encountered on ...
1
vote
1answer
55 views

Join Query effects natural ordering [closed]

If we have 2 tables **user** +----+------+------+-----------+ | id | user | pass | gender_id | +----+------+------+-----------+ | 1 | lisa | good | 11 | | 2 | jack | pass | 10 | | 3 ...
0
votes
0answers
27 views

Filemaker to Firebird data exchange

I want to connect from filemaker to a firebird 2.x DB. Firebird ODBC is not supported, only MYSQL, MS SQL etc. Is there any way to have a translator in between or maybe to connect through a PHP ...
0
votes
1answer
54 views

Automobile database logic

I am building a web based quoting system for a local automobile dealership. I think I have figured out the logic for the databases but I want to get a second opinion before I start just to make sure ...
-1
votes
1answer
54 views

Error in upgrade_from_array - mysql: 1064 query: DROP TABLE IF EXISTS filling tables

Error in upgrade_from_array - mysql: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'myhandyrestaurant' ...
0
votes
1answer
42 views

importing database backup to phpmyadmin return #1064

When I tried importing mysql database backup to MySQL using phpMyAdmin I got the following error message: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your ...
0
votes
0answers
17 views

Connecting to remote sql-server using SQLSRV extension for php and windows authentication [duplicate]

Im using SQLSERV extension for PHP and I successfully connect my page to local Microsoft SQL Server (Native Client 11.0) using both SQL Server Authentication and Windows Authentication but when I try ...
0
votes
1answer
26 views

MS Access + MS SQL Server for 1160+ users - Is it worth it? (Please Help!)

Our school in Delhi (India) wants to develop a professional and robust in-house database (SIS) that should handle vast amount of student information, including admissions, registration, re-enrollment, ...
1
vote
2answers
67 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) ...
0
votes
1answer
64 views

Use string functions and arithmetic calculations in SQL query or by programming language?

I need heavy arithmetic and string functions for processing the data captured from mysql database. Which is preferred: mysql functions or programming language (e.g., PHP)? $result = ...
2
votes
3answers
182 views

how to dump MS-SQL DB using PHP with MS-SQL-SRV.? [closed]

I had created a MySQL database dump in php successfully using this below code. $dbuser='root'; $dbname='Student'; $dbtable='StudentDetails'; $dbhost='localhost'; $dbpass='root'; ...
0
votes
1answer
59 views

Mysql query in Database

How to get all the tables from database with all values in tables using single query.. I tried using $sql = "SHOW TABLES FROM $dbname"; $result = mysql_query($sql); $arrayCount = 0 while ($row = ...
1
vote
0answers
33 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 ...
0
votes
1answer
55 views

Even after permissions are updated, I still get the error permission denied for relation users

I'm getting the error ERROR: permission denied for relation users and have tried to update privileges using both grant all privileges on all tables in schema ops to my_user GRANT ALL PRIVILEGES ON ...
2
votes
2answers
230 views

How to SELECT rows with time duration stored in varchar column?

There is a column in table defined like this : duration varchar(10) It has value for duration of a MP3 file stored in it like : 52:19 (Minutes : Seconds) How can I create a SQL query, for ...
0
votes
0answers
49 views

MySQL + PHP : avoid dirty read

It's possible to avoid dirty read on a MySql database by using a PHP script? i have three two fields (user, incoming_request , outcoming_request) on my table that keep information (as string) about ...
4
votes
1answer
84 views

PostgreSQL PREPARE query with IN () parameters

I'm trying to prepare a query from PHP like: pg_prepare($con, "prep", "select * from test where tid in ($1)"); and then execute it with: $strpar = "3,4,6,8,10"; pg_execute($con, "prep", ...
0
votes
1answer
29 views

Server down after PDO connection

I don't know is this off-topic for this site but I have site that run on PHP and MySQL. And I want to change my MySQL connection to PDO. This is my connection file that I include in every file at the ...
0
votes
0answers
92 views

INSERTS in a loop: Better to use NOW() for each row or PHP date() function once?

Consider a PHP application which inserts about 200-800 records in a loop via prepared queries and parametrized values. The PHP application is on Amazon Web Services, and the database server is in ...
-3
votes
1answer
62 views

error querying data with apostrophes [closed]

I'm getting empty sets from running the following query permutations: select * from gsapi_articles where article_title = "James Dean On Merilyn: 'This Woman Is A True Marvel'" select * from ...
0
votes
0answers
35 views

fulltext search on multiple tables with different fields

I am trying to make a search page return results from multiple table ordered by the keyword. The problem is the select statement gives a result sorted by the select statement and not by the keyword. ...
0
votes
1answer
72 views

Mysql list data from left join query

I have 2 table and i want to pull data from both of them. This is sample for my table structure: Table tbl_a = id, time, note, customer Table tbl_b = id, time, name, surname, note This is my mysql ...
0
votes
0answers
276 views

Occasional disk I/O errors in SQLite

I have a very simple website running PHP and SQLite 3.7.9 (with PDO). After establishing the SQLite connection I immediately execute the following queries: PRAGMA busy_timeout=0; PRAGMA ...
0
votes
1answer
83 views

MongoDB shell version error (Server has startup warnings)

I installed MongoDB under Ubuntu server and when inter to MongoDB shell i got this error and warnings. MongoDB shell version: 2.4.7 connecting to: test Server has startup warnings: Sun Oct 27 ...
0
votes
3answers
705 views

Database design to track student attendance

I was having a doubt regarding the design of a database table to track students' attendance. Currently, my table students have atleast 4000 students. Creating a database for attendance to track their ...
0
votes
0answers
87 views

Data migration of specific data from one DB to another

I am new to this site, I have one major question of data migration, I apologize before hand if the question is too silly. I have two data base on one server, I have one table with the same schema on ...
1
vote
2answers
218 views

multiple connections on MySQL database with no users on httpd

My database seems to have many open connections despite having no users on httpd. mysql> SHOW PROCESSLIST; ...