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

learn more… | top users | synonyms

0
votes
1answer
39 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
12 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
0answers
26 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
11 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
21 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
1answer
74 views

Reviewing relational database tables

I am building a database, but I am a little bit confused with my table relationships. I wish someone could help review my table relationships below for me and tell me where I am going wrong. I have ...
1
vote
0answers
50 views

MySQL keeps inserting new rows automatically [on hold]

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'); ...
0
votes
1answer
64 views

Quickly etablishing if a remote MySQL connection is valid using PHP

I have a hosted website (Namecheap Pro shared hosting) that connects to a remote MySQL database using a read-only user privilege. This remote DB is updated by a separate system. The website works ...
0
votes
2answers
46 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
0answers
11 views

Conditionally updating the columns PHP/MySQL [migrated]

I have embedded the MySQL statements in PHP code. Following is my code: $sql1="UPDATE labdata1 SET Date='$d1' WHERE SL=1"; I want to set the column "Date" to null after 48 hours. What I tried is ...
1
vote
1answer
22 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
2answers
187 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
177 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, ...
0
votes
0answers
23 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
16 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
130 views

how to sync local mysql database and live server database?

My plan is to store data in my local MySQL database and after a time interval it will update my live MySQL database remotely. Is it possible? I'm planing a inventory management script in PHP MySQL. ...
0
votes
1answer
871 views

MySQL PDO Cannot assign requested address

Can someone help me with this error? [08-Apr-2013 17:44:08 Europe/Berlin] PHP Warning: PDO::__construct(): [2002] Cannot assign requested address (trying to connect via tcp://****:3306) in ...
0
votes
4answers
60 views

How to subtract fields and insert the value in other field automatically?

id val1 val2 total 1 10 4 10-4(automatically get the value) . . . . I am using php and mysql. I have a total column I need to make calculation automatically in a field, how it ...
0
votes
2answers
82 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
376 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
132 views

Update table from calculated temporary table

I have two tables, one containing a set of user ID's, vote direction (-1 or 1) and ID of the object they voted on (casted votes table). In the other table, the object id, upvotes, downvotes and ...
0
votes
2answers
69 views

JOIN on three tables is not working

I have these three tables, user, categories and files In users, table I have a column user_id And I have this query that shows all Categories. SELECT `categories`.`category_id`, ...
0
votes
1answer
60 views

Implementing Permissions Database structure on a PHP site to restrict the Access in Multiple levels

I am working on a PHP site that shows the business of a Vehicle Showroom company in which we have 3 users as, Admin(Owner) = Here Admin Have all Access by default(View,Edit,Delete to all) Super ...
-1
votes
2answers
77 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 ...
0
votes
1answer
14 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 ...
0
votes
1answer
78 views

1 million strings and exact match search

I need to chose the best solution (software and algorithm) to solve my problem. I need to store up to million strings and data associated with them. Strings are search queries and data is cached ...
0
votes
2answers
29 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 = ...
3
votes
3answers
486 views

Which graph database for search engine and gis?

I just learned there are "graph databases" out there, which are more suited for two applications "search engine" and especially "gis". To avoid discussions weather a relational DB is better suited ...
6
votes
7answers
39k views

importing large SQL file phpmyadmin

I am trying to import this SQL file in phpmyadmin and got this message #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right ...
0
votes
1answer
123 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
vote
2answers
127 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
0answers
13 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 ...
0
votes
2answers
170 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
vote
2answers
31 views

Garbage DB Objects Cleansing

How do I find in use db objects from all application pages is there any tool or trick I can use, just like we do search in Visual studio for an object in entire solution
-1
votes
1answer
46 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
3answers
1k 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 ...
0
votes
0answers
22 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
1answer
25 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
31 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 ...
1
vote
1answer
69 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
1answer
19 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
2answers
86 views

JOIN on variable number of columns

I have the two tables courses AND something_about_courses: courses course_code course_session course_type something_about_courses course_code course_session some_description To ensure that I ...
0
votes
0answers
9 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 ...
0
votes
1answer
40 views

Creating tables PDO Sqlite

Hello guys i have worked on mysqli but not pdo sqlite i don't know what syntax is to create tables here if not exists this is my code please tell me why am i getting error on last line. $Database = ...
1
vote
1answer
387 views

Saving arrays in database - PDO

I want to save an array in my database friends column. Actually I want to create friend request system. My method is a little bit different. I want to have two columns for this system. ...
1
vote
1answer
52 views

PHP/MongoDB: Unset all fields in a document

I want to use PHP to remove documents from a MongoDB collection, but it's a capped collection (and it's stuck that way until I can get more memory), which means I can't remove documents. I have to do ...
0
votes
1answer
19 views

How does a tagging article database look like?

I have a article website and each article has some tags. How should be my database structure? This is my article table (article): article_id (key) | article_content | article_title | ...
0
votes
1answer
38 views

Searching through ~1M slow

I've never had a database with this many rows, so I can new to keeping the search time to a minimum. I have a database table with 1.5M rows. The primary key is an auto-increment id. Then there is ...
0
votes
0answers
37 views

Should I separate my preferences table?

I have a hobby site where users can find other hobbyists of similar interest. Each user can set a series of preferences that get saved into user_prefs. Right now there are 4 types of preferences, an ...
0
votes
1answer
64 views

How to query group for increase or decrease in value

In MySQl I have a table positions and I would like to find out if position of certain app for certain feed in a certain country type has been increasing/decreasing and by how much from the last ...