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

learn more… | top users | synonyms

0
votes
1answer
33 views

Storing small array of many possibilities

Let's say I need to store the text of a series of books, line per line in a database, and present them in a (CMS-based) website. I thought the correct setup would be: a 'library' table: containing ...
0
votes
1answer
9 views

How to store list data in our LMS?

I am looking at how we can store list information in our database. The example in question is regarding products. For every employee there will be a primary product and as many secondary products as ...
0
votes
0answers
8 views

How many round trips or DB hits do PHP prepared statements cause? [migrated]

This may be the wrong part of StackOverFlow to ask this on but I'm curious... I have looked for about an hour asking google assorted questions and never finding an answer. I have googled... "PHP ...
1
vote
0answers
10 views

PHP and cleansing DB2 data for dynamic Queries [migrated]

I'm relatively new to DB2 for IBMi and am wondering the methods of how to properly cleanse data for a dynamically generated query in PHP. For example if writing a PHP class which handles all ...
0
votes
1answer
16 views

Calculate total attendance for each workshop

I want to get overall attendance in each workshop. NumberOFWeeks column holds the number of weeks the workshop runs. for example Workshop 101 runs for 6 weeks meaning 6 days. So far I have done ...
0
votes
1answer
20 views

replace in String from subquery

I'm currently (trying) to optimize veery weird code. So please don't teach me about bad DB design ;-). Assuming there are two tables messages and options In the messages table theres a string like ...
0
votes
1answer
38 views

combining two different record into single result

I am fetching data from 3 tables with the help of join. My output is in JSON format. Output in JSON format:- {"order_id":"2", "location_address":"Testing location Delhi", ...
0
votes
0answers
23 views

difference between phpmyadmin and php PDO

I'm running a query in Phpmyadmin and also execute the same query with php PDO but results are not equal. What could be wrong ? This is query : SELECT dim_date_key as date ,dim_jdate_key as jdate, ...
-2
votes
3answers
59 views

How to interract with my database? [closed]

I am generally new to Databases, and I have a MySQL server with several tables which have a unique ID that is connecting them all. I am about to populate the db with data from external resources ...
0
votes
0answers
31 views

How should I store image, text type files in mysql?

I came across some answers mentioning the "disasters" of storing files outside database and saving the path inside database. I've also noticed dozens of answers about storing images- which suggest to ...
0
votes
0answers
9 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 ...
0
votes
0answers
26 views

Get disk usage information of mongodb database

I have a database built in MongoDB and I need to obtain information related to the disk usage of the database through PHP. I have searched a lot but did not find relevant search results for retrieving ...
0
votes
0answers
17 views

How to create relations in database

I have two table: users and projects. In projects admin can add projects like: web design, SEO , etc.... I need to add abilty to admin can add some users to certain project... For example I need ...
0
votes
0answers
31 views

How to group two query that have already been grouped

I am creating a chat system and i have two queries: The first query selects the Max(id) meaning the last message that has been received or sent by the member that is connected and that has not yet ...
0
votes
0answers
31 views

Multiple values as single array in Query

Query: SELECT a.*, b.a_val as definition_value, c.a_id as definition_name FROM products a INNER JOIN attr_vals b ON a.sku = b.sku INNER JOIN attr_defs c ON b.a_id = c.a_id ...
1
vote
1answer
73 views

Select with limit, get total count, optimize query [closed]

The site mimics the "likes" tooltip from Facebook, the only difference is that you can like or dislike the content. The tooltip shows the first 12 users that rated the content and displays the number ...
0
votes
0answers
22 views

is it bad practice to do a loop to see if a url parameter is set?

I'm working on a way to include views on my site - if any is requested. Whenever the user access a page, that is valid, I also scan another table to see if there is any available views, and at the ...
0
votes
0answers
23 views

Schema Design for User Privacy Settings

This is how I have normalized my the schema for contact and phone numbers list: Contacts: ID (Primary Key) Name Job Title Phone Number Categories: ID (Primary key) Name Phone Numbers: ...
1
vote
0answers
29 views

PHPMyadmin transactions not commited [closed]

If I create a test table as the one below CREATE TABLE IF NOT EXISTS `TEST` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `NOTE` varchar(50) NOT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB; and ...
1
vote
1answer
51 views

PHP / MYSQL connection failures via socket under moderate load

I've done quite a bit of reading before asking this, so let me preface by saying I am not running out of connections, or memory, or cpu, and from what I can tell, I am not running out of file ...
0
votes
1answer
22 views

How to use language PL/PythonU on a PostgreSQL database via phpPgAdmin?

I am used to PgAdmin III where I can simply create python functions like the following on a PostgreSQL database: CREATE OR REPLACE FUNCTION pyHello (x integer) RETURNS void AS $$ if x == 1: ...
0
votes
1answer
336 views

SQL error: Unknown column in 'where clause' [closed]

I have following very simple PHP MySQL Query: $sql = 'SELECT * FROM bundesland WHERE bkuerzel = ' . $_GET['q']; $result = mysql_query($sql, $con); When I execute the query with a click on a item ...
-1
votes
1answer
21 views

Query error int/varchar LEFTJOIN [closed]

Can someone tell me what´s wrong with this query? $sql = "select bans.id as banid, bans.type, bans.data, bans.reason, bans.expire, bans.added_by, bans.added_date, players.id as playerid, ...
0
votes
0answers
26 views

Big difference between id value [duplicate]

I have this database table where I insert multiple results during 1 action. In php I have a submit button when pressed, inserts 1-50 rows(depending on the user input). I've got a foreign key in this ...
0
votes
1answer
14 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 ...
0
votes
1answer
54 views

Suitable schema to record email sent and response received and invoicing in DB

When a form submission is made on a website: An email with form's details is sent to a set of recipients email addresses stored in a DB. The email contains a link for the recipient to show interest. ...
0
votes
0answers
80 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 ...
1
vote
1answer
69 views

how to get a sorted result from mysql query?

I am trying to get a sorted result from a MySQL query and i dont have any idea of making the query. I have a example Mysql table as follows : id | cat_type 1 | free 2 | free ...
1
vote
1answer
41 views

Sql Insert into with duplicate key

Ok so, I'm still a beginner in databases. I have this code: $sql=" INSERT INTO complaints_members (password, complaint) VALUES ('$mypassword','$submit') ON DUPLICATE KEY UPDATE ...
0
votes
1answer
75 views

How to change a web application that now needs to become OLTP and OLAP application?

Previously, I did a simple web application for an enterprise client using PHP and MySQL. After some time, it has grown to a point where I realized after talking with people here that I need to treat ...
0
votes
0answers
18 views

Using MongoDB with circular object references

Please forgive me from the beginning. I am brand new to document oriented databases and I am sure that I will need guidance to reform the question in order to get answers. I am looking to use MongoDB ...
0
votes
1answer
28 views

What should be the structure for a person-to-person store database

I am going to create a person-to-person store with Laravel, a website whose users can share and sell their product or their mobile, TV, Computer, Shoes, Shirts, Books ,Cars, Bags, Animal etc. I am ...
1
vote
1answer
396 views

Transpose MySQL rows as column names - DYNAMIC

My goal is to be able to calculate the time difference between the ticket timestamp being created and closed and if reopened Add time from being reopened to closed again etc.. I have an existing mySQL ...
0
votes
1answer
17 views

Are my MongoDB servers right in setting?

I have a small web site, so I used two servers. A: master 4G Ram, 96G SSD B: slave 2G RAM, 96G SSD The B server is always for backup, no read, no write. In my application, many users can (and will) ...
-1
votes
0answers
71 views

.dbf files, windows 8.1 reading database [closed]

Good day everyone, At the office I have this accounting application that uses .dbf files to store it's internal database and we wanna do a new interface for it to check out what products are in stock ...
0
votes
0answers
129 views

How to insert into MySQL table SUM of two cells from different tables using insert function

I want to make sum of two cells from different tables in MySQL using INSERT function. The code that I used is: $panoue="INSERT INTO usi2(latime_paneli, inaltime_paneli, latime_panele, ...
0
votes
0answers
543 views

Combine and display multiple row data with same column data in MySQL

I have a menu, from where every item ordered is stored in a row. For a single order, there can be multiple rows.What I want is that when I display it, for same order_number ( number) all rows data is ...
0
votes
0answers
16 views

custom product variant design [duplicate]

I'm building a custom eCommerce solution for a client. I came up with this database design: +---------------+ +---------------+ | PRODUCTS |-----< SKUS | +---------------+ ...
0
votes
1answer
72 views

Hardening further mysql with sqlmap suggestion [closed]

I just ran this tool called sqlmap. It gave me this few list as below. sqlmap identified the following injection points with a total of 0 HTTP(s) requests: --- Parameter: ID (GET) Type: ...
1
vote
1answer
47 views

mysql query from 1st domain and insert in 2nd domain

i have data in one of my website and i want to print these data in other site.these two are in same server.at present i have to export mysql data and import into other then do this code to insert in ...
0
votes
4answers
90 views

Pros and cons of a particular DB design approach for single vs multiple tables

I just got a new project (in JAVA) where I am thinking of all the pros and cons of a particular DB design approach. Some pointers: Our app has many "content" entities like News, Blogs, CMS pages, ...
0
votes
0answers
14 views

How can I update the amount on parentid

I'm using MySQL database,This is the first time that i handle this kind of project the Multi-Level Marketing.I am having problem in updating the amount of parentid if he gets paired means he has left ...
0
votes
2answers
48 views

SQL Query Help to get Quiz statistics

I'm coding a quiz web application and i need help. I've got three tables Nicknames : |USER_ID|NICKNAME| that stores USER_ID(auto increment) and NICKNAME registered to my system. Questions : ...
0
votes
0answers
81 views

UPDATE & DELETE multiple rows with an array for the id

I wan't to check for challenges a user's team posted that have not been excepted after 1 day, then autorefund the user's team back there credits, and then also delete all the challenges. So far here ...
0
votes
0answers
47 views

Points/Scores display from and to the Database in Android app

I am an absolute beginner to the Android programming and I am trying to develop an Android application using Eclipse where user is able to login/register and is able to see his "white" points based on ...
1
vote
1answer
115 views

How can one drop all default values and allow NULL for all columns of a table?

I'm working on a PHP script to modify the primary key (PK) of a table. My current code is: $q = "SHOW KEYS FROM $db.$table WHERE Key_name='PRIMARY';"; $keys = Query ( $q); if ( $keys) { $q = ...
1
vote
1answer
123 views

IF statement in ON clause

Can you help correct the syntax for this code? INNER JOIN Users u ON case when c.sender = ? then c.reciever = u.id else c.sender = u.id How do I do I put a CASE statement in a JOIN clause?
0
votes
1answer
37 views

DB/table design help [closed]

I have 50,000 unique cards in a table. A minimum of 2 cards and up to 20 cards can be chosen by the user and they can write a blurb about it. There will be times when the cards chosen by different ...
0
votes
0answers
12 views

Horribly slow MySQL (InnoDB) updates, multiple workers [duplicate]

I've created a PHP daemon that reads records from a MySQL InnoDB-table, analyses it and then updates the record. This process is spread between multiple workers (and servers) using Redis. However, ...
2
votes
1answer
5k views

connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host

Hello I am trying to run a website sent to me but after doing so this error appeared connect to PostgreSQL server: FATAL: no pg_hba.conf entry for host "4X.XXX.XX.XXX", user "userXXX", database ...