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

learn more… | top users | synonyms

0
votes
1answer
206 views

Zip based search in mysql.

I want to implement a zip based search in mysql database, I am populating the location column in my database based on a drop-down where in I have predefined zip codes, now if a user wants to search ...
0
votes
0answers
78 views

Database Schema/Structure advice

Well i am reconstructing an already created application and was looking to improve this, especially with in the database structure. I want to start off with probably the biggest section and that is ...
0
votes
1answer
125 views

how to use mysql to delete only the first ten table records?

I'm currently using php and mysql together. What I want to try is if I have ten "stable" records for the database and in the same .php file I have some text boxes so I can type in then what I typed ...
0
votes
1answer
219 views

Mysql - Problem speed of access on query (Low latency query sometime)

My web application is real time site that need a speed of access on every query (SELECT, UPDATE, INSERT) that must less than 200ms Because one of my php script task is query (SELECT, UPDATE, INSERT) ...
0
votes
1answer
129 views

Large queries on MyISAM tables crashing MySQL

I have a PHP website, which is using the third-party software ResourceSpace, that when I installed it, it used my default storage engine to create the tables, which at the time was MyISAM. Now that ...
2
votes
1answer
1k views

Why does that query cause lock wait timeouts?

From time to time, I find a lot of these errors in my PHP error log: MYSQL.1213: Deadlock found when trying to get lock; try restarting transactionSQL The problem persists for about 2 or 3 minutes. ...
3
votes
2answers
366 views

Implementing soft delete

Could someone please show or describe to me how to implement soft deletes? I have table of vouchers with these fields: id, username, password, serial. I want to display a given number of rows ...
4
votes
1answer
1k views

mysql_connect() system error :111

I have 2 VPS. I would like to connect from the frist to the second's mysql db like this : $db = mysql_connect("94.xxx.xxx.xxx:222", "user", "pass"); I got this error: Warning: ...
0
votes
1answer
220 views

Making a message system

I have created a messaging system with MySQL structure is as follows `message_id` int(11) NOT NULL AUTO_INCREMENT, `message_from` int(11) NOT NULL, `message_to` int(11) NOT NULL, ...
0
votes
1answer
57 views

Setting up a use voting table

I had a table to store user votes for other users. So user1 can vote for user2 (vote up or vote down). One user should be able to vote for many users, but not repeatedly to the same user; user1 can ...
0
votes
1answer
909 views

Problem with (not) Locking Tables during Restore

First time here in DBA. I'm working to create a simple and strong database backup plan. My solution that is already working to create a gzipped, encrypted backup is: $string = "mysqldump -u$db_user ...
0
votes
1answer
41 views

Using multiple server databases

I was just seeking some higher advice on whether or not having your main data on one database, then having separate server database to use for frequent updating and reading will prove to be an ...
1
vote
0answers
432 views

mysql remote connect

Having troubles with this and I'm not sure why.. I'm trying to access a mysql database from another server. I changed the my.cnf file (uncommented the bind-address to access from all): port=3306 ...
0
votes
1answer
178 views

PHP and mySQL - Binding a parameter in an if statement

Setup: I have 4 tables: guestList eventList inviteList rsvpList The descriptions of the tables: guestList +-----------+-------------+------+-----+---------+----------------+ | Field | Type ...
0
votes
0answers
227 views

MySQL Left Join Select all rows

Hi guys I have a query which is pulling data from database : SELECT sandwich_table.id, `sandwich_name`, salad, COUNT(salad), salad_type.type, ...
0
votes
0answers
156 views

Try to find a match using SUBSTRING(SHA1(value)), 0, 6)

I have a tbl where all entries for companies that participate in a online project are saved. This table is named "business". Those companies can use their employess to access the online platform i 've ...
2
votes
1answer
5k views

Server requested authentication method unknown to the client [mysql_old_password]

Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] SQLSTATE[HY000] [2054] The server requested authentication method unknown to the ...
1
vote
3answers
3k views

How can I copy data from one MySQL server to another based on a SELECT statement (then delete the data from the original)?

I have a very large log table from which I want to copy rows, putting them into the same table structure on a new server. I don't want to copy everything, only old rows, so that the table on the main ...
2
votes
1answer
520 views

Mysql - show results from 3 tables excluding NULL or EMPTY values for certain fields

I have 3 simple tables with polls, users and votes. I'd like to show all polls ordered by clean count of votes (sometimes either poll_id or user_id don't get inserted). Furthermore I'd like to show ...
0
votes
1answer
3k 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); ...
1
vote
1answer
194 views

MySqli - select from db based on time difference with CURTIME() or SUBTIME()

I have a db with some customers data. There I store their last login time as datetime. I want to run a cron php script every min which will query mysqli for their last login datetime and if that was ...
1
vote
3answers
307 views

MySQL large databases, unique index effect on efficiency?

I'm working on a table which holds around 300k records. I'm using a 3 columns unique index to prevent duplicate records. For some reason the database is taking long to insert new rows. I have a few ...
0
votes
1answer
150 views

MySQL collate error occurs when sent by PHP app but does not occur in phpMyAdmin

I have a query that uses: t3.`value` LIKE "%someval%" COLLATE utf8_general_ci I load the page in my browser and get this error printed to the screen: COLLATION 'utf8_general_ci' is not valid for ...
2
votes
1answer
255 views

Parsing and binding variables for SELECT .. WHERE column IN ( .. ) queries

I'm looking to make sure that all queries in a php web application have proper use of bind variables to minimize parsing of the queries. I'm wondering how Oracle parses queries that compares a ...
1
vote
1answer
128 views

Group activities in activity feed by users and products

On my website I'm building an activity feed where I got the basics done and are now making some improvements here and there. One of them is the grouping. I've built it so that if multiple users buys ...
1
vote
2answers
302 views

mysql_select_db() very slow on a busy server

I have a MySQL Server with about 30 Databases and 1500 Tables. Overall size of the data is 2 GB. The Server has 16 GB RAM and an AMD FX-6100 CPU. Most tables are myisam. On average the server answers ...
3
votes
1answer
189 views

What is the right way to manage users data?

I'm trying to create a simple register login script with user profiles, I created a table with the following structure: +------------+---------------+------+-----+---------+----------------+ | Field ...
1
vote
0answers
174 views

big mysql database optimization

My Joomla mysql database has about 3.4 million rows in content table. It is just static article. Very slow and often use out of resources. To speed up it, I segmented it into 6 sub-tables and added ...
9
votes
1answer
296 views

Calculate MATCH() AGAINST() scores from UNIFIED QUERY not FOR EACH TABLE

I am trying to have a score for entire section of SELECT statements SELECT *,MATCH(`result`) AGAINST('keyword') as `score` FROM `table1` WHERE MATCH(`result`) AGAINST('keyword') UNION SELECT ...
0
votes
1answer
1k views

Importing CSV file to MySQL via PHPMyAdmin

I am currently stuck and unable to upload a complete CSV file into a MySQL database. Unfortunately, the nice folks at Stackoverflow haven't been able to help me solve this issue, so I'm hoping someone ...
1
vote
2answers
100 views

Cannot INSERT into database on a shared server

I have launched an application on a shared server but I cannot INSERT any data. I thought maybe I don't have privileges so I did SHOW GRANTS in my application then die() The result was [ EDITED ]: ...
2
votes
1answer
1k views

how to retrieve rows of different dates using IN clause

My table structure: +-----------------+--------------+------+-----+-------------------+----------------+ | Field | Type | Null | Key | Default | Extra | ...
0
votes
1answer
371 views

Too many records on database and how to handle it? MySQL is it good to clone?

I am doing a social network and came up with the following concern regarding database storage. Let's put facebook as an example, imagine 2,000 photos per user, just 1,000 users, it would equal to ...
4
votes
2answers
115 views

Understanding COUNT() as `count`,

I'm currently learning how to build a site in PHP mysql. However, I seem to fail to understand COUNT() as count and wouldn't mind some further explanation. I get the principles of COUNT, 0 || 1, and ...
-1
votes
2answers
163 views

How to update an SQL column using a known perm link while appending a value from another column within the same table? [closed]

Larger view of the issue is here: http://i1268.photobucket.com/albums/jj572/LinuxOwner/question.png
0
votes
3answers
514 views

Deleting Data From Multiple Tables

Suppose,I've a table called UNIVERSITY containing universities name: universityID universityNAME isACTIVE 7 GNDU 1 6 PU 1 5 ...
1
vote
2answers
225 views

PHP-MYSQL messaging system performance problems

I want to create a messaging module for the social network web-site project (PHP & MySQL) I've been working on. What substructures do well-known sites use for modules like this? I think, ...
1
vote
1answer
60 views

Sanitizing a form's database input while retaining basic HTML markup

Is there a way to sanitize database input (say, for a comment form), which also allows for the end user to use basic HTML styling markup? As in, if a user wraps their text in <i>/<em> or ...
5
votes
3answers
994 views

InnoDB Master-Master replication goes inconsistant after power failure tests

Afternoon gents, I'm currently stress testing a Master-Master replication setup using InnoDB as database engine. We're using this simple script for testing which we run in Linux CLI from a remote ...
1
vote
1answer
396 views

calculate the difference between two column aliases in a SELECT statement?

I'm not sure how to do the last part of my query, which is doing calculations directly with the aliases: (SUM(task_avg - minutes) AS difference. I don't think I can do it as easy as I'd like, but ...
2
votes
1answer
661 views

shopping cart database schema

I need help creating the schema for a database to hold information relative to a web user's shopping cart/session. Each session will have a session ID, a time stamp holding time of creation, an expiry ...
0
votes
1answer
58 views

Searching through lots of applications

Google search has instant search feature. While you are typing, it finds the pages. Apple.com search box. StackExchange ask question part finds similar questions while you are typing question title. ...
0
votes
1answer
83 views

Is Index Used for This Query

If so, which one? How do we know? I have 3 indexes in a query. Actually only the first 2 should be useful { "v": NumberInt(1), "key": { "LongitudeLatitude": "2d", "Prominent"▼: ...
0
votes
1answer
562 views

database creation using codeigniter database dbforge class gives “Access denied for user 'username'@'localhost' to database 'database_name' ”

Using codeigniter database dbforge class I have created a database and loaded that database as the current database and created tables in localhost WAMP server. But when I uploaded it to the server I ...
3
votes
1answer
752 views

Mongo connection failing with 'Transport endpoint is not connected'

I have a 2 server installation. A web server with Apache and a DB server with MongoDB. I am load testing it, and on ~300 RPS I am getting this error: PHP Fatal error: Uncaught exception ...
3
votes
3answers
257 views

Database design for changing number of fields

Google Contacts lets you to enter more than one phone number, or email address for a contact. You can add as many as you want. I don't know if there is a limit, other than practical list size. To ...
0
votes
1answer
653 views

WorkAround for PHP PDO(with libpq V 9.1.4) binding for use of CITEXT?

The scenario Two systems(not server) running PHP and PostgreSQL with the following versions Fedora 15: PHP PHP 5.3.13 (cli) (built: May 9 2012 14:38:35) Copyright (c) 1997-2012 The ...
1
vote
1answer
260 views

MySQL table locks solution -> InnoDb / Partitions

I'm experiencing many table locks in a MyISAM MySQL table that is pretty big (Constx10xGB and 15M rows). It's mainly caused due many heavy inserts. My current thoughts to optimize: Changing to ...
4
votes
2answers
244 views

Escaping T-SQL Keywords

$sql = "SELECT Kill FROM tbl_pvporderview"; Problem is that I end up with: Incorrect syntax near the keyword 'Kill'. Because kill is a T-SQL command... any way to bypass it? I can't change the ...
0
votes
0answers
553 views

Sqlsrv sqlsrv_num_rows FALSE, adding cursor type times out

$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; ...