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
im making a form on php which saves data into the database here is the code for it where i send data from php form to the database: <?php $users_name = $_POST['name']; $users_email = $_POST['email']; $users_phoneNumber = $_POST['phNo']; $users_cnic =
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
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
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
I need to select and Get a single unique value from a table where the key has duplicate entries. For instance there is a Transaction ID(Id) and an AccountNumber(AccountNumber) and for each account number there are many entries but I have to get only
I am retrieving record from mysql table which return more than 0.2m number of rows per query, which obviously take lot of memory. in my case i have 8 GBs installed RAM on my system with SSD 256 GBs. When i execute my page it returns the following err
I need to extensively use statuses in mt project. I need them for my users (active, suspended, etc), an entity (active, pending_activation, inactive) and for my subscriptions(active, on_grace_period, not_subscribed, never_subscribed). So far I though
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_
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
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)
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
I have the following People table: | Id | FirstName | Children | |----|-----------|----------| | 1 | mark | 4 | | 2 | paul | 0 | | 3 | mike | 3 | Note I have an non-unique index in FirstName and another one in Children. I need to get the top 10000 fi
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
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`
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',
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
I am on MacOSX using MySQL Workbench 5.2.45 I have designed a database using the EER Diagram functionality and then tried the forward engineering to generate my database to put on my local server. I get the error code: Error 1005: Can't create table
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
We have two DBs on different servers - S1 is a remote server with a DB we use for login authentication, S2 has our application and app-database. When you login, we check the user against S1 and then create a user object in S2 using some S1 data. Is t
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
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
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
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
My normal process for inserting into one table and then getting the ID back so that I can insert into another table is like this in MSSQL: DECLARE @transactionKey uniqueidentifier SET @transactionKey = NEWID() INSERT INTO transactions(transactionKey,
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
Using MySQL The two fields I need to compare the current date to are: startDate, endDate I need a query something like this: SELECT * FROM `{$this->_sPrefix}` WHERE `profileID` = '{$iProfileId}' AND CUR_DATE() BETWEEN `startDate` AND `endDate` ORDER
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
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
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