7,494 Archived Topics

Remove Filter
Member Avatar for
Member Avatar for [NOPE]FOREVER

I have a specialization hierarchiy with one parent table and two children. I am in a situation where one column in the child table is a pk, fk, fk and unique. TICKET_NUMBER = pk, fk1, fk2, u1 This is how I have currently tried to create this table but im …

Databases
Member Avatar for hericles
7
220
Member Avatar for [NOPE]FOREVER

I have 3 tables --Ticket_Lines (parent), Labour_Items (child), Part_Items (child). Table Ticket_Lines has 2 primary keys (ticket_number & ticket_line_number) I know that you cant have two seperate primary keys in one table so would this mean that ticket_number and ticket_line_number is a composite primary key? if that is correct, is …

Databases mssql sql
Member Avatar for hericles
5
156
Member Avatar for Dani

Sometimes you need to delete duplicate rows in a database :) In the future, set UNIQUE keys when you need them :) In the example below, we have a table appropriately named `TABLE_NAME` and there are multiple rows that have the same value for the `duplicate_field` field. In this example, …

Databases mysql
Member Avatar for Usamatamimi
4
4K
Member Avatar for Dani

Last night, a friend mentioned to me that one day he was trying to fetch a random 5 rows from a MySQL database. He researched online, and was eventually presented with a working solution in which he would generate five random numbers. Then, he would query the database for items …

Databases mysql
Member Avatar for abubaker_2
4
593
Member Avatar for [NOPE]FOREVER

I have a php/mysql project. When the admin deletes a customer or product from the database on the form I need an confirm box to show and ask the admin if they are sure they want to delete and have the customer row show in the confirm also. Here is …

Databases display mysql php
Member Avatar for pritaeas
4
344
Member Avatar for rproffitt

> Last month, Facebook admitted to storing million of Facebook passwords in plaintext. The Verge Apr 18, 2019 We see students being taught login systems here and a recurring mistake is passwords being stored in databases. It appears that CompSci courses teach bad practices early and as we know it's …

Member Avatar for AndreRet
3
3K
Member Avatar for happygeek

According to the fourth annual [Web Application Attack Report](http://www.imperva.com/download.asp?id=419) from Imperva retailers suffer from twice as many SQL injection attacks when compared to other industry sectors. What's more, the United States remains the number one source of all web attacks. Other key findings of the report include the startling revelation …

Member Avatar for LastMitch
3
332
Member Avatar for cored0mp

Hey! I've been asked to store some data from a client in mysql in an encoded format using python. Nothing could be easier, right? I will later need to decode the same data using mysql exclusively. Given that constraint, I thought that base64 would be the go to since nearly …

Databases mysql sql
Member Avatar for cored0mp
2
975
Member Avatar for Vandiun

I'm working on an SQL query for a complex reporting system that involves multiple tables and joins. However, the query's performance is not meeting my expectations, and I suspect that the way I've structured my joins might be inefficient. Here's a simplified version of my query: SELECT orders.order_id, customers.customer_name, products.product_name, …

Member Avatar for DGPickett
2
166
Member Avatar for estherschindler

The job you’re applying for says, “Redis experience required.” Are you ready for the questions a hiring manager is likely to ask? Here’s [how to prepare for the job interview](https://redis.com/blog/redis-interview-questions/)... as inspired by Lord of the Rings. Nominally the article is written for someone getting answers ready for Redis-specific questions, …

Databases career redis
Member Avatar for rproffitt
2
68
Member Avatar for vbacoder1962

This was a query raised by one of a forum members at another site, where he had a worksheet filled with random numbers, and I have already answered that query [at my post here](https://vbacoder1962.wordpress.com/2019/07/15/extracting-cell-phone-numbers-from-random-strings-of-variable-length/). You may go through that post and read the logic behind the code. ![vbacoder_Code_20190715.jpg](/attachments/large/4/160efbe4e4d0a8400d04653a6e420c7b.jpg)

2
1K
Member Avatar for thomas_39

I receive an error message and I don't know what to do about it. IO have a delphi app using a MS Access 2010 database. I connect to it through BDE. It worked perfectly until today when the users told me that they can't enter my application due an error …

Databases delphi
Member Avatar for chuckc
2
376
Member Avatar for Bob Hensley

# MySQL Stored Routines: Another Useful Scenario # [In a past guide](http://blog.bobbyhensley.com/sql-procedures-functions-authentication-example/) I discussed MySQL stored routines within MySQL. Now I’m back with another guide on MySQL stored routines. And this time it’s a more concrete case; one that you may run into yourself in the future (or maybe you …

Databases mysql sql
Member Avatar for batuzai04123
2
520
Member Avatar for happygeek

A Drupal security advisory, [SA-CORE-2014-005](https://www.drupal.org/SA-CORE-2014-005), rather embarrassingly states that: > Drupal 7 includes a database abstraction API to ensure that queries executed against the database are sanitized to prevent SQL injection attacks. A vulnerability in this API allows an attacker to send specially crafted requests resulting in arbitrary SQL execution. …

Databases cms cybersecurity sql
2
352
Member Avatar for sathish_nadu

I am using MySQL 5.0 on WinXP pro. Below is the script for creating the table CREATE TABLE `tbl_test` ( `gameID` VARCHAR(45) NOT NULL, `gameName` VARCHAR(100) NOT NULL, `gameStartDateTime` DATETIME NOT NULL ); INSERT INTO `tbl_test`(`gameID`,`gameName`,`gameStartDateTime`) values('gameID1','gameName1','2008-01-01 1:00:00'); INSERT INTO `tbl_test`(`gameID`,`gameName`,`gameStartDateTime`) values('gameID1','gameName1','2008-01-01 8:00:00'); INSERT INTO `tbl_test`(`gameID`,`gameName`,`gameStartDateTime`) values('gameID1','gameName1','2008-01-01 12:00:00'); I would …

Databases mysql
Member Avatar for diafol
2
247
Member Avatar for rotten69

I created a foreign key on a table just using this statement. When I wanted to drop it, phpMyAdmin didn't allow me to do so. Would anyone suggest a nice way of getting away with it? [code] ALTER TABLE `likes` ADD CONSTRAINT (fk_user_id) FOREIGN KEY REFERENCES `users` (user_id); [/code] This …

Databases mysql
Member Avatar for rotten69
2
6K
Member Avatar for axes2t2

First the table [CODE]create table customer( no int NOT NULL auto_increment, cust_id varchar(15) NOT NULL, cust_name varchar(50), cust_address text(150), cust_phone int, cust_email varchar(30), PRIMARY KEY(no));[/CODE] Then the trigger [CODE]DELIMITER | CREATE TRIGGER trig BEFORE insert on customer FOR EACH ROW BEGIN set new.cust_id=concat(new.cust_name,new.no); END; DELIMITER |[/CODE] Then the insert query …

Databases mysql
Member Avatar for smantscheff
2
117
Member Avatar for tyson.crouch

G'day, I've got my SCMA tomorrow morning, and I thought i would post up my notes. These notes are intended as a general tutorial/guide for MySQL. [B]It covers the following topics:[/B] [B]Section 1: Theory, Terminology and Concepts (10%)[/B] [LIST] [*]Client/Server Concepts [/LIST] [B]Section 2: Data Definition using SQL (25%)[/B] [LIST] …

Databases client-server mysql
Member Avatar for rajarajan2017
2
225
Member Avatar for happygeek

In an [URL="http://www.guardian.co.uk/technology/2010/jan/24/computer-security-crime-anonymous-datasets"]interview[/URL] with The Observer newspaper, Dr Ian Brown from the Oxford Internet Institute who is writing a report on anonymous datasets for the European Commission warns that "criminals could identify individuals through mobile phone data and use the information to track people's movements and find out when they …

Member Avatar for DeAnonym
2
309
Member Avatar for cored0mp

A script that was working fine on 100 records per batch choked when I fed it 1,000 records. It gave: mysql.connector.errors.OperationalError: 1040 (08004): Too many connections So I went ahead and made sure to connect.close() everywhere that I opened a connection, and the script made it much further but eventually …

Member Avatar for cored0mp
1
285
Member Avatar for cored0mp

This week I'm working on the data warehousing capabilities of my application. Now most people here who have built more than a couple of applications can tell you how useful it is to include a datestamp on records or requests as they come in. The advantages are numerous. So much …

Databases mysql python sql
Member Avatar for WendyDolan
1
131
Member Avatar for Paplu

![WhatsApp_Image_2024-09-24_at_6.48.00_PM.jpeg](https://static.daniweb.com/attachments/4/13a53e2c778a9eb1d9f9055cdd5ceeb9.jpeg) ![WhatsApp_Image_2024-09-24_at_6.48.00_PM_(2).jpeg](https://static.daniweb.com/attachments/4/c1e539c7bd293b3d7bf99779bd43a179.jpeg) ![WhatsApp_Image_2024-09-24_at_6.48.00_PM_(1).jpeg](https://static.daniweb.com/attachments/4/ff2865a364a3277cbd970fedd88efb3e.jpeg) here is three Sql table name of them - 1. orders 2.order_item 3. target_value I am trying Two way here is may two code : 1 SELECT I.target_id as Iid, I.target_date as Idate, I.customer_name as Icust, I.target_product as Icat, I.target_pay as Ipay, I.target_rec as Irec, I.active as …

Databases mysql php sql
Member Avatar for Paplu
1
148
Member Avatar for cored0mp

Recently made a decision for an app I'm working on to accumulate data in batches AND THEN to insert it into the database with one statement rather than adding 1,000 records through one thousand separate inserts. Is this done better through file or memory? If I write the segments of …

Databases mysql python
Member Avatar for DGPickett
1
221
Member Avatar for mx_983

Basic background information Mariadb Ver 15.1 District 10.11.6 MariaDB Glarea cluster, one with three nodes: Node1:192.168.18.78 Node2: 192.168.18.79 Node3: 192.168.18.80 Among them, Node1 node was restarted after a power outage of 1 hour, and after executing the system ctl start mariadb, it was stuck for a long time (running for …

Member Avatar for toneewa
1
73
Member Avatar for Audun

This is the error message: >>> %Run -c $EDITOR_CONTENT Traceback (most recent call last): File "<string>", line 6 image = cv2.imread(“C:\Users\Audun Nilsen\Pictures\pica.webp”) ^ SyntaxError: invalid character in identifier >>> This is the code: import cv2 # OpenCV for image processing image = cv2.imread(“C:\Users\Audun Nilsen\Pictures\pica.webp”)

Databases
Member Avatar for Audun
1
86
Member Avatar for cored0mp

Hey Gang! OK today I am having trouble with my transaction processing application implemented in python/MySQL. Here is some "working" testing code. import psycopg2 from psycopg2 import Error import binascii from binascii import unhexlify import mysql.connector as mysql sql='''CREATE PROCEDURE testprocedure(OUT tacos INT) BEGIN show tables; SET tacos := 1 …

Databases mysql python
Member Avatar for Dani
1
165
Member Avatar for cored0mp

More programming fun! OK this time around I'm trying to create a table with the statement, CREATE TABLE tablename ( recnumber SERIAL PRIMARY KEY, recordvalues VARCHAR ( 500 ) NOT NULL, datecreated DATE ) And it basically works, and I can add records using the dba account. However when I …

Databases postgresql
Member Avatar for cored0mp
1
119
Member Avatar for cored0mp

How do I create a table in postgres that's associated with a specific database? Obviously from the command line one can do Create table tablename (); But how do I make sure that the table is associated with the correct database? CREATE table dbname.tablename(); is giving me the error: ERROR: …

Databases postgresql python
Member Avatar for Dani
1
162
Member Avatar for happygeek

[URL="http://www.ibm.com"]IBM[/URL] researchers have [URL="http://www.zurich.ibm.com/news/07/asme.html"]unveiled[/URL] prototype 3D visualisation software that will enable doctors to interact with their medical data in pretty much the same way they interact with their patients. The technology, known as the Anatomic and Symbolic Mapper Engine (ASME), uses an avatar representation of the human body which the …

Member Avatar for Jose_52
1
698
Member Avatar for RC_820

i have 3 tables : users, deposit, withdraw **table users :** id , username, referral 1. 1, a1, null 2. 2, a2, a1 3. 3, a3, a2 4. 4, a4, a1 5. 5, a5, a2 **table deposit :** id, users_id, amount, status, approve_date 1. 1, 1, 10000.00, approve, 2022-10-01 14:52:53 …

Databases mysql sql
1
105
Member Avatar for varcore

i am running ubuntu 22.04 and php 8.1 / MariaDB , i am missing somthing here in my code just can't see it. the premise of the code is to look at the TrolleyID Field and if it's '00000' basically echo's "BAD-READ" else it's 'GOOD-READ' any help would be great …

Databases mariadb php ubuntu
Member Avatar for Dani
1
119
Member Avatar for EpifaniaPersons

Hi Everyone! I am new here, and the main purpose of joining this community is getting some help. Actually, I am designing a PHP website where I need to fetch US vehicles data into PHP. I have already used this source to get the vehicle's dataset from here https://www.back4app.com/database/back4app/car-make-model-dataset. Still, …

Member Avatar for RayPalmer
1
357
Member Avatar for Yacine Si Tayeb

# Introduction # As we move into 2022, businesses will continue to look for ways to become more data-driven. This means that knowing how to use Structured Query Language, commonly called SQL or 'Sequel', will remain an essential skill for data scientists, analysts, and developers. In this post, we'll provide …

1
119
Member Avatar for Dani

DaniWeb was written in Codeigniter, and when posting to the forums, we use database transactions that look like this: $this->db->trans_start(); ... insert into the posts table ... ... update the member's post count ... ... update the tags table ... etc $this->db->trans_complete(); On occassion, the error log will show for …

Databases mysql
Member Avatar for Dani
1
4K
Member Avatar for Komlika_1

Consider the following database Room (room_no,room_name,room_type,charges) Guest(Guest_code, Gname,city) The relationship is as follows: Room-Guest: one-to-one. room_type can have values as either ‘AC’ or ‘NonAC’. Q 2) A Create the above database in PostGreSQL and insert sufficient records.

Databases postgresql
Member Avatar for john_111
1
2K
Member Avatar for kevinG73

I have a database where there is an table `wm` for water meters : +------+---------------+ | Code | name | +------+---------------+ | wm1 | water meter 1 | | wm2 | water meter 2 | | wm3 | water meter 3 | +------+---------------+ and another table c`ounters` where there are …

Databases sql
Member Avatar for Geek-Master
1
190
Member Avatar for squigworm

Hi everyone I am wondering if someone can help me understand why the Sub-Query's SELECT statement ended up producing the column name 'Code' vs. the initial SELECT statment call 'local_name' in the below screenshot Thanks in advance! ![Query_SUB_QUERY_question_.png](https://static.daniweb.com/attachments/2/9db9bca69fea80f23ce39603536c5590.png)

Databases sql
Member Avatar for Dani
1
65
Member Avatar for larry29936

I'm trying to create a trigger that does two things, first take an ip that's in dot notation and run inet_aton on it and put the result in another field. Second, checks a lookup table to identify an ip range that the result of the first action falls into and …

Databases mysql
Member Avatar for larry29936
1
258
Member Avatar for Biiim

I come across this problem every so often and end up having to do work arounds when I would prefer to keep it in the database. I have a query where the data in the query updates frequently so the query won't stay in the cache but I don't need …

Databases mariadb mysql sql
Member Avatar for Biiim
1
1K
Member Avatar for macusberts

Please I'm trying a simple connetivity with VB.Net to Microsoft Access Database and it keeps giving this erro message.... Please i need help Thisis the error it gives The 'Microsft,ACE.OLEBD.12.0' provider is not registered on the local host

Databases microsoft-access
Member Avatar for spiderxman
1
2K
Member Avatar for mksaeed

Hi guys, This is my first post and so glad to start sharing the knowledge. I am using Mysql database with VB.NET and I have this code : Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim str As String = "Server=localhost;Port=3306;Database=testdb;Uid=root;Pwd=password" Using con As New MySqlConnection(str) Dim …

Databases mysql sql vb.net
Member Avatar for Santanu.Das
1
3K
Member Avatar for Dani

I need help with implementing MySQL transactions with PHP. Specifically, I'm confused between the flags `WITH CONSISTENT SNAPSHOT`, `READ WRITE`, and `READ ONLY`, what their differences are, and how they relate to table locking. I already read the MySQL reference manual but I'm still confused.

Databases mysql
Member Avatar for Dani
1
2K
Member Avatar for Saif_5

We have built a software web-portal (POS system) in PHP language. Which is working fine when online. But when the internet goes down in the stores, the software stops completely and the managers are not able to make bills till the time internet is live again! Hence we want to …

Databases mssql mysql php
Member Avatar for Ashraful_2
1
2K
Member Avatar for JerieLsky

Hi, not very familiar with mysql. I have here a mysql statement: table customer: [CODE]CREATE TABLE Customer (SID integer, Last_Name varchar(30), First_Name varchar(30), PRIMARY KEY (SID));[/CODE] table orders: [CODE]CREATE TABLE ORDERS (Order_ID integer, Order_Date date, Customer_SID integer, Amount double, Primary Key (Order_ID), Foreign Key (Customer_SID) references CUSTOMER(SID));[/CODE] My question is, …

Databases mysql
Member Avatar for Inderjeet_2
1
8K
Member Avatar for xuexue

i want to combine multiple rows into a single row using **DB2**. I have found this code, but I do not know how can i edit it>? CREATE FUNCTION MySchema/MyUDF ( PARCol2 CHAR(5) ) RETURNS VARCHAR(1024) LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA CALLED ON NULL INPUT DISALLOW PARALLEL BEGIN …

Databases sql
Member Avatar for Nate_3
1
2K
Member Avatar for rproffitt

`Select * from contacts WHERE behavior = 'nice'` [SQL Clause is coming to town.](http://imgur.com/gallery/KvsXO) Not mine, [Little Bobby Tables](https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables) almost ruined Christmas.

Databases sql
1
237
Member Avatar for archibald_1

After a server issue, my client has restored the MySQL files before their issue, but MySQL is having problems bringing their database back up. (i'm waiting for more information as the exact nature of the issue) I have the ibdata1 ib_logfile0, and ib_logfile1files, and all the .frm and .ibd files …

Databases mysql
Member Avatar for rproffitt
1
378
Member Avatar for Daniel_57

Hi Guys, I'm new to vb.net programming. I'm finding it really hard printing selected columns in a datagridview. there are 12 columns and i would like to print just a few in a landscape view. Please, can someone help me.

Databases vb.net
Member Avatar for Royce_1
1
155
Member Avatar for LudvikTabor

HI: I had a archived copy of my email on the local system. Due to some problem my C: drive of the system got corrupted and i had already taken one copy of my archive folder. After reinstalling the OS and Lotus Notes now i have kept the archive copy …

Databases email
Member Avatar for LudvikTabor
1
283
Member Avatar for Dani

Funnily enough, I have absolutely no experience with MySQL foreign keys. I'd like to change that :) My database schema is rather complicated, and I have a lot of work ahead of me, but let's simplify things. Suppose I have **Members Table:** id (PRIMARY KEY) username first_name last_name company etc …

Databases mysql
Member Avatar for cereal
1
327

The End.