how to match the exact timestamp of the database with my date

Hi i have doubt regarding how i can exact match my database timestamp with my date i'm getting date from my URL query string which looks like this 2017-07-19 and my stored date in my database is 2017-07-19 13:40:23 Below query returns 0 results despi

How to find the nearest value in PHP

How to determine the RESULTS field in table users, base on USER SCORE field with the provisions of the value closest to SCORE BRAND field. This is table Brand <table> <tr> <th>BRAND NAME</th> <th>SCORE BRAND</th> </t

Securing PHP API to use in the Android app

I am newbie to android development. I am using android studio for developing an application. Things i have done Created a DB with two tables in it in MySQL. Created two separate api's for both GET and POST methods. Successfully accessed both api's Wh

Select something in a nested selection

In my database, I have a table salaries which stores all past or current salaries from the employees, and a table employees which stores my employees. I am trying to select all employees that got a promotion: select first_name, last_name from salarie

Create a div for each array row retrieved from MySQL

We have a bunch of data in a MySQL database which call by using this phpcode: $query = "SELECT * FROM `dmt_objects` WHERE PipelineAndWorkflow = 'RWP WF Ready for 4Sprint' ORDER BY `Team` DESC ;"; $select_projects = mysql_query($query); $project_

Yes or No following a sql request without using IF or CASE

Is there a way to make a query and return 'yes' or 'no' as an answer without the use of Flow Control operators? The only solution I thought is: select 'yes' as answer from blabla where blabla but this of course works only if the query found some resu

MySQL - How can I do this channel search?

I have a table which features 37 columns, of various types, INTs and VARCHARS and 2 LONGTEXT columns. The client wants a search to search the table and find the rows that match. However, I'm having trouble with this. Here is what I've done so far: 1)

Sorting Proximity Search by Post Code by Distance (php / mysql)

I have a table (user_zip_codes) with the users' zip_code, latitude and longitude. I have found a function here on stackoverflow that finds zip codes within a specific radius: function zipcodeRadius($lat, $lon, $radius) { global $mysqli; $zipcodeList

MySQL result at VB.NET table

I am creating a program in VB.NET which uses an online MySQL database to retrieve certain data. I have now succeeded in connecting and getting some basic stuff out of it. Now, what I want to do is that when an user presses a button it has to update t

Join tables with different field names using Grocery CRUD

I have the below tables CREATE TABLE IF NOT EXISTS `maintrequests` ( `id` int(11) NOT NULL AUTO_INCREMENT, `propID` int(11) DEFAULT NULL, `landlordID` int(11) NOT NULL, `subject` varchar(45) DEFAULT NULL, `message` varchar(200) DEFAULT NULL, `status`

What is the best way to prevent XSS?

Which is better method to prevent XSS attacks? Here is the code I am trying to do. Is this line of code enough to prevent XSS attacks? or Do I have to parse each element with 'strip_tags'. Thank you for any suggestions. $xss = array_map('strip_tags',

Error creating xml from mySQL database with php

I am following this tutorial from google for google maps: https://developers.google.com/maps/articles/phpsqlajax_v3?hl=es I formatted my code as so: echo '<markers>'; // Iterate through the rows, adding XML nodes for each for($i = 0; $i< $brewery

PHP linking a wildcard

Hope Somebody will help me about how I bind a parameter in mysqli when a multiple character wildcard needs to be next to the variable value. I found that it worked for me when creating a SQL statement, like this: $sql = "SELECT item_title FROM item W

MySQL Replication Does Not Run Updates in Binlog

I have a number mysql servers running version 5.1.63 and whilst running some queries against the slave earlier this week, I noticed some data on the slave that should have been removed using an update statement on the master. My initial thoughts were

Create a table dynamically from the mysql query

I'm trying to create a page where I input a MYSQL query: SELECT column1,column2 FROM table;, and dynamically create an HTML table with column titles. EDIT: removed most of my question, just left the question part. I have since created a script that d

MySQL Amazon RDS: Lock Timeout Exceeded

On Mysql (Amazon RDS), when I try to run the following SQL query UPDATE table1 INNER JOIN table2 USING (CommonColumn) SET table1.col1 = table2.x, table1.col2 = table2.y I get this error after around 52 seconds consistently: Error Code: 1205. Lock wai

create a table of 900 attributes in mysql

Im trying to create a really big sql table that consists of 900 attributes. Is there an easy way to create a table in mysql that consists of 900 attributes without having to manually type them in? I have the name of attributes in a text fileGet each

In MySQL, is it possible to have a UNIQUE constraint on a line?

Appears that MySQL's UNIQUE constraint is on a columns by column basis, I'm looking for a way to make sure the row are UNIQUE on a row by row basis; guessing the answer is to create a hash from by concatenating the columns per row I want to be UNIQUE

How does the store procedure really work?

am used lot of time , i know the diff between sql query and sp , SQL query will be compiled everytime it is executed. Stored procedures are compiled only once when they are executed for the first time. This is general database question But one big do

Database strategy for more than 10,000 instances of an ERP

I have a moderately large rails ERP application having around 80 tables . I use MySQL . I recently received a client requirement which needs me to deploy the same application for roughly 10,000 offices(an instance for each office). The central office

Manage multiple images with ColdFusion and MySQL

This is an architecture question, but its solution lies in ColdFusion and MySQL structure--or at least I believe so. I have a products table in my database, and each product can have any number of screen-shots. My current method to display product sc