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

learn more… | top users | synonyms

5
votes
1answer
242 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", ...
-1
votes
1answer
34 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
106 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
127 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
215 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
102 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
536 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
185 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
2k 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
118 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
415 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; ...
0
votes
0answers
175 views

how to update current row value by selecting previous row value in php mysql

How can i update data of current row with selecting data of previous row in php mysql. I have tried following query but it showing me error. update sales_tracking set sales_tracking.opening_units = ( ...
0
votes
0answers
179 views

MySQL stops responding (at almost regular intervals)

Using mysqld (latest xampp version). My.ini port= 3306 socket = "D:/xampp/mysql/mysql.sock" basedir = "D:/xampp/mysql" tmpdir = "D:/xampp/tmp" datadir = "D:/xampp/mysql/data" pid_file = "mysql.pid" ...
0
votes
1answer
452 views

Connecting to remote oracle db

I am very new to system and db admin stuffs. Infact, I need to have my skills more improved in those areas. Anyways, I was trying to connect to a remote oracle database and use php oci8 library to ...
1
vote
1answer
104 views

Saving LZW encoded data into a mySQL database

I send LZW compressed data from the client side with JavaScript to the server. The problem is that the data becomes corrupted after saving it to database. So my question is, what collation should I ...
-1
votes
1answer
38 views

Would This Work? [closed]

This is just a basic script for updating my database from form data. I don't have much experience with databases and this might be a bad question but I have read online that you should use UPDATE ...
2
votes
1answer
243 views

Using the auto increment id from one query as the fk of the next insert

I'm not sure if I'm overcomplicating this or whether I can't see the wood for the trees. I have two tables, both have auto incrementing ID's. Table 1: ID - auto field - int other field - varchar ...
3
votes
4answers
999 views

How to securely connect app and database servers?

(Updated) For a start, I have my app and database on separate servers. It's easy to connect them, except I am not sure how to secure my database server. Here's what I've already done: Ran ...
0
votes
1answer
170 views

I need advice on these queries

could you help me optimize these queries? here are queries, please note that you see something like OR 1=1 OR those are values I pass via php and may change. query#1: SELECT posts.status, ...
-1
votes
0answers
59 views

ERROR 1136 Need help mysql [closed]

I am working on my sql via mysql. I need help with a code. I am able to create the table; however, I am having trouble installing the data into the table with out getting the ERROR 1136. CREATE ...
0
votes
1answer
38 views

migration sql 2003 to 2008, Sql side and php side [closed]

I have a system in php using MSSQL 2003. I need to change the database to MMSQL 2008. I want to know if there's issue I should look at on SQL Side (Query/SP/....) PHP Side (Query, connection type, ...
1
vote
0answers
204 views

What is the best way to manage user access to MySQL via PHP?

I am working on a web application that requires auditing db queries in MySQL. In every application that I have developed or worked on it is standard practice to store the DB credentials in a protected ...
2
votes
1answer
127 views

Mysql Fragmentation. How bad is too bad?

I ran a table status for my companies production site and its showing close to around '49085939712' for just about every table in my database and we have around 400 tables. I am not a DB ...
1
vote
0answers
196 views

Need to search users by latitude and longitude

I'm still learning SQL and this is a bit more advanced than my capabilities, so I could use some help. I think I need a sub-query or something. In the database I have a table called user with a ...
0
votes
1answer
455 views

How can I join two tables while filtering the results with a“ WHERE IN” clause? [closed]

What I am trying to do is set up a selection filter for a cascading list on my site. When I say selection filter, I mean I am trying to limit, and sort the results based on what the user selects. I ...
1
vote
1answer
326 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() { ...
0
votes
1answer
6k 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
votes
1answer
56 views

Database update rather than cycle through? [closed]

I'm new when it comes to MySQLi and databases so I'm not sure how exactly to title this question. I have a PHP script setup to where it inserts data into the database. Pretty self explanatory. ...
0
votes
2answers
817 views

Difference between two recordsets

I'm looking to calculate the difference between two record sets in MySQL. Say I have the following table: colname type attrbutes id uInt PK date date PK count uInt With this data: id ...
1
vote
1answer
82 views

Recover Wrong encoded string values in MySQL database

I have a database in which I store the alt and title values of the images. Unfortunately the program which inserts these values hasn't been connecting to the MySQL database with a UTF-8 link and the ...
1
vote
2answers
326 views

How to calculate total ON hours and Total OFF hours in day of a motor using PHP and MySQL [closed]

In my application I would need to calculate total ON hrs and OFF hrs in a day of motors in one tank. Every time he/she turn ON/OFF motors, data will go and store in motor_status_log table of my ...
1
vote
2answers
2k views

MYSQL matching one column to another in a different table via a FULLTEXT index

I current have two different tables. The first table has a list of titles and IDs associated to these titles, the second table is a list of random heading. What I would like to know is if there is a ...
1
vote
3answers
543 views

Why are there different levels of MySQL collation/charsets?

Looking at the MySQL server variables the server and database collation are set to latin1_swedish_ci but the collaction_connection is utf8_general_ci. Additionally, the collation/charset is set at ...
0
votes
2answers
598 views

Which is better: more rows or more columns in a student attendance table?

I want to create an attendance table for student attendance. Which structure should I go for? I have two options. attendance(student_id,date,is_absent,reason) ...
4
votes
5answers
1k views

Fast way of delete MySQL record

I have a 1.2 million record in a database table( it use index column also) I want to delete old 1 million record. I try to do it using PhpMyadmin but it take more time. DELETE FROM `table` WHERE ...
-2
votes
0answers
49 views

MySQL-CLuster PHP5 [closed]

I have installed correctly MySQL Cluster on my Vm's the mgm nod with two SQL/Data node and everything looks ok, but I cant run my application because MySQL Cluster dont see PHP5 anyone know how to ...
0
votes
0answers
78 views

Automated query log

I would like to ask for some opinions or recommendations or guidelines on how to create an automatic logging system for the executed querys on a MySQL database. Some details: its a php+mysql ...
-1
votes
3answers
592 views

App can't find or connect to database

I'm trying to install a web app on my Ubuntu 12.04 server. The app is based on PHP and MySQL and I've got LAMP already working OK on my server - infact I've already got other apps working on PHP & ...
0
votes
1answer
530 views

User roles and permissions

Look at the attached graphic. I'm trying to keep this as simple as possible. Basically I want to have multiple admins(or superusers) who own regular users who own sites. Admins can give regular ...
0
votes
0answers
138 views

Query should yield result but doesn't

I need to get data from a remote SQL 2000 server and store it in a new MySQL server. I am using the FreeTSD module for php 5.3 to connect to the SQL 2000 server. I can connect without problems. ...
1
vote
1answer
2k views

How to run a SELECT query within while loop in PHP?

Within a SELECT query via PHP while loop, I need to run a mysql SELECT query as $result1 = $mysqli->query("SELECT * FROM table1"); while ( $row = $result->fetch_assoc() ) { if ( $row['X'] == ...
0
votes
2answers
176 views

database structure - complicated requirements

I have a project to build a website but it's complicated and I'm having trouble figuring out what the best way to build the database would be to handle these particular requirements. The site is for ...
0
votes
1answer
485 views

The UPDATE permission was denied on the object

I'm connecting to a remove Microsoft server running MsSQL via PHP. The code looks something like: $con = mssql_connect('0.0.0.0:123', 'user', 'pass') or die(log_mssql_error(__FILE__, __LINE__, ...
-2
votes
1answer
92 views

how to count primary key of one table inanother table? [closed]

how to count primary key of one table which is used in another table in 5 to 6 column? If table 1 has primary key srno which is used in table2 in column d1,d2,d3,d4. I want to count how many times ...
0
votes
0answers
307 views

Mysql 5.6 and install php5-mysql , mysql-common

I install Mysql 5.6 with this documentaion(in ubuntu 13.04) , now I need to install php5-mysql and mysql-common packages. can I install them with apt-get? I think they will install mysql5.5 ...
0
votes
1answer
425 views

Simple MySQL table copy from one server to another?

this question has kindof been answered in a number of ways. Nothing that quite fits the bill (as far as I understand it). I have MySQL Table X on Server A. I would like an exact copy of this table, ...
0
votes
1answer
69 views

Search speed increase

I've heard that some queries like DELETE, or changing the structure of a table can decrease the speed of the search in a table. First: is this true , or not? Second: is there any way to increase ...
0
votes
1answer
83 views

Am I overengineering MySQL?

On my project, I have to make difference between registered users, and simple visitors. Both of them can set their own properites, specified in accounts and visitors table. I identify them by cookie, ...
0
votes
0answers
421 views

MySQL is running but not working [closed]

In an attempt to tune MySQL to make it work with a recent installation of Drupal I had to modify the MySQL settings on my server. After modifying the configuration file for MySQL (/etc/my.cnf) MySQL ...
0
votes
2answers
5k views

Insert data in current table and update another table MySQL

I'm having problem with inserting in purchase table and updating facility table. Let's say, user made a purchase with product_id and product_quantity. When user hit submit, I want to insert ...