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

learn more… | top users | synonyms

0
votes
0answers
20 views

searching through entire database php script

$tableArray = array('tbl_course','tbl_faculty'); if(!empty($_POST["searchField"])) { $search=$_POST["searchField"]; foreach( $tableArray as $tblArry) { $out ...
0
votes
4answers
21 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
8 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
14 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
16 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
7 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
40 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
119 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
35 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 ...
-1
votes
1answer
18 views

PDO over network, hangs MySql Database after running 1 to 3 hours? [closed]

I have the following class --------------------------------------------- CRUD Code Snippet-------------------- class CRUD{ function __construct(){ $this->db_user = "user_name"; ...
0
votes
0answers
36 views

Horribly slow MySQL (InnoDB) updates, multiple workers

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, ...
0
votes
0answers
11 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, ...
0
votes
1answer
47 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 ...
2
votes
1answer
34 views

How can I speed up an sql query that round trips between two tables

I first posted this question on stackoverflow, and now I see this site, seems more relevant. These tables are not that big, but the time taken to process this query is long. What can I do with the ...
0
votes
3answers
14 views

How can I speed up an sql query that round trips between two tables

These tables are not that big, but the time taken to process this query is long. What can I do with the following queries to speed up the process taken to return results? $msc=microtime(true); ...
0
votes
1answer
22 views

insert multiple authors only if it exists in MySQL [closed]

I have a problem . I am doing a PHP -My SQL project . I got to store author/s of a conference paper in a database . But sometimes its just 1 and sometimes it can be 2 or 3 or 10 . So how do i store ...
0
votes
1answer
50 views

Unknown column in 'where clause'

I've a query in my php script $result = mysql_query("SELECT State_Id FROM state_master WHERE State_Name='$statename'") or die(mysql_error()); $row=mysql_fetch_assoc($result); return $row['State_Id']; ...
0
votes
2answers
54 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
53 views

insert data into mysql from mssql with arabic unicode

I insert data into MSSQL with arabic unicode. I want to insert this field into MYSQL but it insert empty. In MYSQL , I choose utf8-bin , I use php for this action, I declare name , character unicode. ...
-1
votes
3answers
64 views

What is wrong with this INSERT Statement

I am trying to use this statement to insert new data into my orders table like so: $tsql2 = "INSERT INTO pedidos (numero_local, emailUser,codigopapel,cantidad, color) VALUES ('$local', '$emailOn', ...
0
votes
0answers
25 views

Advice on table structure change

I am in the process of converting an Access application that stores and reports evaluations to being web-based using php and mysql. I have converted the structure and data over from Access and I have ...
0
votes
1answer
56 views

MySQL Performances Issues

I'm in debate with my database admin. He claims that my queries I'm sending through PHP are the problem and he is stating several things I believe are completely false. To begin I have a site ...
0
votes
0answers
26 views

WHERE in CASE in mysql

$sQuery = "SELECT SQL_CALC_FOUND_ROWS ".str_replace(" , ", " ", implode(", ", $aColumns))." FROM (select CASE when r.agent_id=24 THEN r.Unit ELSE '--' END AS MyUnit, CASE when r.agent_id=24 THEN ...
0
votes
1answer
90 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 ...
2
votes
2answers
43 views

How to retrieve elements from another table in a SQL query?

Sorry for my english !!! I get data from a table wp_posts and now I need to get data from the table wp_postmeta that match the ID captured in wp_posts table. The data that I need to grab in the ...
0
votes
0answers
24 views

Improve processing of data and structure design from flat file to CMS DB (using intermediate DB)

I have a flat file (CSV) that brings me the data I want, but it needs to be cleaned and processed before it can be used, so I built an intermediate Database (MySQL) in order to get the structure from ...
0
votes
2answers
27 views

Meaning of 'show variables LIKE '%_database'

Despite being a newbie in db administration, I have been assigned to move our crm from mysql to mssql. I have reached a point where I have met a query I dont understand and it cannot execute in sql ...
0
votes
0answers
12 views

first query on my table takes apx: 0 sec but taking too much time on or after 3 to 4 query

I have the following table in mysql database: CREATE TABLE `chronologicallists` ( `sno` int(250) NOT NULL AUTO_INCREMENT, `empSno` int(11) NOT NULL COMMENT 'Employee Serial Number', ...
1
vote
1answer
79 views

Large MySQL table, inserts with primary key check

I have a table with 12 million of rows and a following task I should frequently perform: Get search results from somewhere (50 rows). Each result has a key looking as a md5 hash and a table's PM is ...
0
votes
1answer
60 views

Retrieving month from date field in my database

i have dates stored in database with the function : CURDATE() , when a user makes an order . Now with a form where the admin chooses the month and the year , i want a query to display all the orders ...
0
votes
0answers
65 views

Best way to approach building search functionality using PHP on existing mySQL Database

I am looking for advice on how to approach an upcoming project I am due to undertake. The reason I am asking is that I'm just out of college and the company I work for is currently searching for a new ...
0
votes
3answers
163 views

db connection uses an anonymous logon instead of the domain user

I have this PHP code running under IIS: $serverName = "someServer\someServer"; $connectionInfo = array( "Database"=>"SOME_DB"); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn ) ...
0
votes
1answer
38 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, ...
0
votes
1answer
109 views

sqlsrv_connect: use Windows authentication?

I have a PHP server running under IIS on serverIIS1, and a MS SQL database on serverDB4. I created some PHP code that runs on the serverIIS1 server: $serverName = "serverDB4\serverDB4"; ...
1
vote
0answers
65 views

MySQL keeps inserting new rows automatically [closed]

I have no clue of what is going on. My script goes this way: $i = 0; $c = $somecount; while($i < $c){ $en = comment_version($comments, $i, 'en'); $ru = comment_version($comments, $i, 'ru'); ...
1
vote
1answer
36 views

SQL : get rows from two tables relatively

I've two tables named categories and products. Simple structure is given below. categories cat_id cat_name 1 c1 2 c2 3 c3 products prod_id ...
0
votes
0answers
64 views

MySQL check if user has the required privileges before execute CREATE query

I'm working on a get started wizard in my application, and I've come to the part where the user needs to create tables in order to proceed. That can be done in two ways; either copy/paste the provided ...
0
votes
0answers
19 views

Merge colums from two different databases using phpMyAdmin

Is there a way to: Replace all the data from database1 > table1 > column2 With Data from Database2 > table1 > column2 ONLY under the condition that the ID value in database1 > table1 > column1 ...
0
votes
1answer
26 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
votes
2answers
95 views

Can you store PHP code in mysql database?

I'm creating a codex that will store example of functions and examples on how to use functions. Can I store this information in a database? Also, is there a proper way of displaying code on a page?
0
votes
2answers
39 views

MySQL Count Rows with Two Cells the same

I have a db where the cells are height and width. (It's for banner ads) Some banners are the same width, but different height, or visa versa. for example: row1 hieght = 600 width = 120 row2 hieght = ...
0
votes
0answers
14 views

different php files on same mongoDB connection in php

I am new to both PHP and mongoDB. I want to know if there is any way to run a PHP project having different files on a single mongoclient(); I have created one connection.php file which is used for ...
-1
votes
1answer
58 views

Is there any limit for MySQL database rows

I'm creating a database website which has a lot of data (Username,name,address,posts etc). Is there any limit to store database rows? (I have a table with more than 100,000 rows) How to host this ...
0
votes
0answers
58 views

select value between particular date and time schedule

I have database "raj" with table "pagination" In table pagination have "id", "actualtime" and "created" field id - auto_increment actualtime- varchar created- datetime that looks like this CREATE ...
-1
votes
2answers
314 views

query to select data between todays date as well as tomorrows date time upto specific time

I have database "raj" with table "pagination" In table pagination have "id", "actualtime" and "created" field id - auto_increment name- varchar created- datetime I want to display all rows which is ...
-1
votes
1answer
61 views

How to select different format of the date in mysql

0 down vote favorite i have this table and i cant change its format to yyyy-mm-dd because i have so many scripts that are related to this format dd-mm-yyyy , it would be a mess if iam gonna change ...
0
votes
1answer
32 views

Merge 2 SQL statements into 1?

Can anyone help me transforming these 2 SQL statements into 1? $query2 = "SELECT DISTINCT `UID` FROM `ratings`"; $query3 = "SELECT `RID`,`rating` FROM `ratings` WHERE `UID` = $uid"; original php ...
0
votes
1answer
35 views

MySQL Query logic for filters for wordpress site

I'm a WordPress (PHP) developer, however I have not done a lot of complex MySQL queries. I am working on an events website and want to create filters: User should be able to filter events by the ...
1
vote
1answer
154 views

MongoDB performance problem

I have a MongoDB for storing result like this {_id, type, imei, lat, lng, spd, dir, time} {_id, type, imei, lac, cid, time} If type is f first one is used and if it is l second one is used. Here ...
0
votes
0answers
12 views

PHP error log naming by date

Running MySQL 5.5.1 on Server 2008 R2 Currently using the following directive in php.ini error_log = C:\path\${COMPUTERNAME}.log, that works fine. Does anyone know of a similar variable I can use ...