I have a table like this CREATE TABLE IF NOT EXISTS users_groups( id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, user_id INT(11) UNSIGNED NOT NULL, name VARCHAR(250) NOT NULL, is_deleted BOOLEAN NOT NULL DEFAULT false, creation_date DATETIME NOT NULL,
I have a client that use my web application for debts control. He wants to save and backup all data so if something happened to his laptop, he could repair his data. I told him to enter to phpmyadmin and click on export, but he think that it is littl
hello i am new here and will be happy for the help i have 1000 posts in my site that contain the word "free" i need to replace the word "free" only in 20 posts that contain another word "blue" so from 1000 posts only 20 of th
CAUSE: I have a table and the columns are all suitably Collated as utf8mb4_unicode_ci, CREATE TABLE IF NOT EXISTS `users` ( `user_id` int(8) NOT NULL AUTO_INCREMENT, `username` varchar(100) NOT NULL, `pass_word` varchar(512) NOT NULL , ...etc etc...
im new to laravel and i am currently doing a study project in laravel 5.2. Thr project is just a simple website having 3 pages (Home, About Us, Contact Us) fetching each page content from database and the home page having a slideshow. For that i down
I am creating my first Wordpress plugin and have been stumped for a couple of days. So far I am trying to just get my plugin to save data to the MySQL database on my localhost. When I enter info into the form it creates a new row, which auto incremen
I have written a script that establishes an SSH tunnel and connects to a database over that tunnel. Extremely simplified nutshell (obvious parameters and extra logic omitted): sshTunnelCmd = "ssh -N -p %s -L %s:127.0.0.1:%s -i %s %
[email protected]%s" % ( sshp
In page.tpl.php of Drupal, the following code has variable $page which contains the html codes that are required to render part of the webpage. <?php if ($page['content']): ?> I'm trying to retrieve the updated content from DB at an interval and upd
Looking for posts matching two keywords (both, not just one of them). I guess the reason why the following MySQL query returns no matches is that keywords matching "climate" and keywords matching "recycling" are not the same rows in th
Hello i am trying to build a listview and populate it from values in Mysql database. The list with SimpleAdapter works but i decided to change the listview and use my own adapter that extends ArrayAdapter and create my own listItem and not the HashMa
I'm new to MySQL and I am facing a little problem that I couldn't find an answer to in any previous thread here, so I was hoping someone could help, okay here it is: When typing a request on mysql (on the terminal) you can just press enter to make it
I've come across a slight issue when designing a trigger statement in our MySQL DB today: We have the following relevant tables: quote (quote_key, date, discount_rate, discount_period, supplier_key) part (part_key, part_name, ...) part_quote (pq_key,
I need to show some records sorted based on modified column (latest activity on top) (Post with new edit or comments at the top) App UI has twitter like 'more' post button for infinite scroll. each 'more' will add next 10 records to UI. Issue is that
Below is the sql connection code for my php script as it attempts to connect to my Google SQL Cloud Database <?php $con=mysqli_connect(":/cloudsql/projectID:google-cloud-instance","root","root","DATABASE"); // Ch
I have a php page in which i use $_GET to get a variable from a previous page. So in this page I have declared it example $id=$_GET['id']; $car=$_GET['car']; And then I have some php functions which uses this variable. So the url to this page looks s
If I have a table where each row is a customer booking, is it OK to have 2 foreign keys in this table: one which will be null and the other referencing the primary key approriate. The reason I have two tables with the foreign key constraint applied t
Say I have a table of people... person: ----------- id | person ---+------- 1 | Jim 2 | Bob 3 | Frank ...and I have a table of items... item: ---------------- id | item | type ---+------+----- 1 | 21 | 2 2 | 10 | 5 3 | 11 | 1 4 | 9 | 1 ...and I also
I have two table,their structure are below : CREATE TABLE `metaservice`.`user` ( `id` bigint(18) NOT NULL AUTO_INCREMENT, `userId` bigint(18) NOT NULL, `name` varchar(40) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `userId` (`userId`) USING BTREE, K
I'm executing my maven build and it throws this exception: Last cause: Wrong column type in x.clients for column type. Found: tinyint, expected: integer I'm mapping like this: @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer id; An
I have a table with data like the following id name created parent ------------------------------------------------ 1 Alpha 11385209583 0 2 Bravo 11385209619 0 3 Bravo-A 11385209701 2 4 Bravo-B 11385209777 2 such that Bravo-A and Bravo-B are children
I am in the process of designing a fairly simple login system, and I currently use the following code when a user attempts to log in to determine whether there is an entry in the database that matches the username that the user tries to log in with.
Suppose, I have a modifying statement: cursor = conn.cursor() # some code affected_rows1 = cursor.execute(update_statement1, params1) # some code conn.commit() cursor.close() Should I wrap the block of code with a try ... except and explicitly rollba
I get the following error: Duplicate entry 'morandi-midnight-train' for key 'post_name' I want to check if post_name field has already a row defined with a variable and echo an error if it does. How can i acomplish this? post_name has a unique indexR
I have a MySQL table with Spatial Points, and need to calculate distances. I found lots of material on doing this using the Haversine formula, however all of these assume a large distance between points. In my case, I only care about short distances
I have multiple If statements that if true, inserts data into the db. The Problem is that the 2nd one of the INSERT statements inserts it 4 times. How would i stop it from adding duplicates. Also the returned $_POST['tshirt'] contains only one value
Does anyone know of a good script (or good strategy) for doing a fuzzy street address search on a MySQL database? The key issues are: capitalization (easy -- just use LCASE) punctuation (could use REPLACE; not sure it there are more efficient options
I'm trying to return to write a query that only returns first result where someid (result of the first case)=X - and ignoring subsequent results where someid=X. How would I alter the following query to achieve that? Here's what I'm currently using: S
What I need seems simple, but I haven't been able to pull it off so far. Maybe it's just these late hours, or maybe it's not that simple after all, I don't know any more :) So, here's the thing. I want to be able to check whether the search string fr
I have one table ( members ) and five columns ( username , password , FirstName , LastName , Email ) I need to get the Email for the user admin. How would this be done? SELECT Email FROM members WHERE username = 'admin';
I have received this database full of people names and data in French, which means, using characters such as é,è,ö,û, etc. Around 3000 entries. Apparently, the data inside has been encoded sometimes using utf8_encode(), and sometimes not. This result