[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi,
I'm fairly new to php and mysql but I'm creating a PHP and MySQL web application for a client. I have a register.php page with the following form fields:
Contact Name, Phone, Email, Password, Confirm Password, Ticket Holder Password and Ticket Holder Confirm Password, where Users can register/sign up to use the app. Once they do register, they get redirected to admin_login.php page where they can login and get full access to the app and various other pages I've created.

My Problem:
My Password validation functions aren't working and I'm not sure why. I want the passwords to be a minimum of 8 characters, contain one upper and lowercase letter, a number and a special character. I'm using a regular expressions code that I found online. What I want is to validate the Password fields, so if the User enters a password that meets the criteria mentioned above than it should INSERT the data INTO the database, if it doesn't meet the Password criteria mentioned above I want to display an error message saying: "Password must be minimum of 8 characters, contain one upper and lowercase letter, a  number and a special character". I'm new to using php functions and how to call them properly.

This is the code in my functions.php page:

<?php

// FUNCTIONS.php

// clean the form data to prevent injections

/* Built in functions used:
   trim()
   stripcslashes()
   htmlspecialchars()
   strip_tags()
   str_replace()
*/

function validateFormData($formData) {

Open in new window

0
SolarWinds® Network Configuration Manager (NCM)
SolarWinds® Network Configuration Manager (NCM)

SolarWinds® Network Configuration Manager brings structure and peace of mind to configuration management. Bulk config deployment, automatic backups, change detection, vulnerability assessments, and config change templates reduce the time needed for repetitive tasks.

I have read turning on auto shrink on databases in SQL Server is a bad idea as it can cause 'fragmentation'. What is your view on this - and from a tech free risk assesment what may fragmentation cause in terms of performance or any other visisble symptom to  a database and its over arching application. Is there any official guidance from microsoft on the risk vs reward of turning on auto shrink on databases.
0
I have a VBA frontend system which connects to a mysql backend.

It authenticates on manually created mysql users which are setup to allow access to further databases once authenticated.

I need to investigate offering users to ability to change their own mysql password without having an admin having to do it at command line level.

Obviously im consious of security and need to get some ideas on how to acheive this.

thanks
0
How to fully allocate RAM without ever experiencing RAM paging?
I was looking at - http://www.dba-oracle.com/art_dbazine_ram.htm

The database continuously receiving below error - flndb46p2.
ORA-04031: unable to allocate  bytes of shared memory ("","","","")

These are the current memory setting on the server and DB side.

SQL>  select instance_name,status,to_char(startup_time,'DD-MON-YYYY HH24:MI') startup_time from v$instance;

INSTANCE_NAME    STATUS       STARTUP_TIME
---------------- ------------ --------------------------
flndb46p2        OPEN         05-MAY-2018 21:16

SQL> show parameter sga

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
sga_max_size                         big integer 3G
sga_target                           big integer 3G

flndb46p2@ltdi31cdz:/odb/ods01/orabin/diag/rdbms/flndb46p/flndb46p2/trace>free -g
             total       used       free     shared    buffers     cached
Mem:            47         45          1         26          1         29
-/+ buffers/cache:         14         32
Swap:           35          6         29
flndb46p2@ltdi31cdz:/odb/ods01/orabin/diag/rdbms/flndb46p/flndb46p2/trace>cat /etc/sysctl.conf |grep huge
vm.nr_hugepages=17283

flndb46p2@ltdi31cdz:/odb/ods01/orabin/diag/rdbms/flndb46p/flndb46p2/trace>grep Huge /proc/meminfo
AnonHugePages:         0 kB
HugePages_Total:    2054
HugePages_Free:        0
0
I have a dynamic web project ( SOAP web service), which takes parameters from a received message and inserts data to oracle db. This all works fine. However, db connection url, password and user are hardcoded.

This web app will be distributed to a number of servers with different db connection details, so it can't be hardcoded and generating a new app for each server is not an option.

I wonder if I could store needed info in an xml file and read from there. Is someone able to give me a nice simple example of how to do it?

Also, where such file would have to be placed, bearing in mind it would have to be possible to edit it after the deployment?
0
Hi,
I have created the following table-
CREATE TABLE rbl_kyc_profile (
      userid int8 NOT NULL,
      kyctype varchar(50) NOT NULL,
      effectivekycstatus varchar(50) NOT NULL,
      validfrom timestamp NULL,
      validtill timestamp NULL,
      authtype varchar(50) NULL,
      ovdnumber varchar(50) NULL,
      attrs jsonb NULL,
      name varchar(100) NULL
);
Many places i have seen an extra column id in the table.
Do i need to do that in this table ??
what are the pros and cons of it ?

Thanks
0
Looking for a query to query all non-system tables in an Oracle 11g database for a given value
Additionally, If you can given a flavour of the same query which can search all the table starting with "ENV"  or "DOC"  , it is much appreciated
0
Running Sharepoint 2010 Site for use as a budgeting tool. The external content types we created uses BCS to connect to a Sql2008r2 Server to pull content from views on the Finance database. A recent Software uprade required 'SQL2012' we had no choice but to move the database to a Sql2012 server. This was done successfully and it's been a few weeks now and all went well. However we ran into some problems changing the Server name for the External System named 'LiveDB'  We were getting errors but managed to work through them and finally had it connected and running after editing an unused External System called 'LiveDB2" ONE BIG PROBLEM THOUGH the ECT tabs were open in Sharepoint Designer and to close them we were prompted that unsaved changes existed and faced with having to discard changes or Save Them.  We weren't sure what these changes were but didn't want to take a chance that the changes we made to get the BCS and ECT  working would be lost. So we save the changes and immediately we opened the Sharepoint site and as soon as we clicked the link that retrieved the External content we got the following error:  
This web part is configured to display a type of data that no longer exists in Business Data Connectivity.  Open the tool pane to reconfigure the web part. Administrators, see the server log for more information.   Correlation ID:0d38e495-6e97-4f5f-894b-fece5461e07d  
Can anyone tell me how I could possibly get this  back or what change would cause something like …
0
Hello Expert,

Need to identify all tables in database
that begin with prefix  'D_'.

In PL/SQL (Oracle 12c) have tried

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLE
WHERE TABLE_NAME LIKE 'D_%'

SELECT table_name
FROM INFORMATION_SCHEMA.tables
WHERE name = 'd_%';

Both of these return
'Invalid table name'

Think these may be for SQL Server

Tried

SELECT TABLE_NAME
FROM ccm.user_tables
WHERE TABLE_NAME LIKE 'D_%'

This returns 'Table or view does not exist'

Thanks.

Allen in Dallas
0
I have a SQL server DB dump and need to convert to a MySQL database DUMP or import in MySQL database.

Which tool is the open source and most suitable for this conversion ?

We don't have sufficient space or memory to install or import SQL server in our machine. However we have the MySQL installed.

Please advise.
0
Starting with Angular 5
LVL 12
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

The database has a set of tables that, when an user clicks the Edit button,
creates a draft copy that preserves a copy of the record in case the user
discards the edit. The d_address table mirrors the address table.
The d_employer table mirrors the employer table. There are dozens of
pairs.

For rather complex reasons drafts that are older than a couple of months cause
primary key constraint violations and errors in the front end application.

So the boss says delete all drafts older then three months.

A SQL script is written:
Delete FROM
    ccm.d_address
   where trunc(last_update_date) < '03-SEP-18'

And so several dozen of these scripts should be
written. All the table begin with d_  with syntax
d_tablename.

Is there a way to loop thru (or other method) the tables deleting older
draft records?  

Thanks.

Allen in Dallas
0
Is there any way a simple SQL Delete statement using a WHERE numeric column = numeric value can result in an Arithmetic overflow error converting numeric to data type varchar without a trigger?

delete OrderMeetings  where OrderMeetings.ORDER_NUMBER = 71935.00
Arithmetic overflow error converting numeric to data type varchar.

Open in new window


I have a customer saying that they are getting errors when deleting a row in a table. They can literally go into SQL and run a delete statement - as shown above - and it gives an Arithmetic overflow error converting numeric to data type varchar. They swear there are no triggers on the table. They sent us a copy of their database - no triggers but we can't replicate it either. However they say it always happens every time for them.

The ORDER_NUMBER column is numeric(15,2)

Any ideas?

They are using Microsoft SQL Server 2016.
0
Hi
Finally, after buying a second-hand book on SQL Server two days ago I managed to spot a recommended code on linking access app to SQL server database tables see below what they are saying:
When writing VBA code in Access, ADO (ActiveX Data Objects) is the preferred object model for working with SQL Server. However, the DAO (Data Access Objects) object model is more efficient and full-featured for working with Access objects, and tables linked to SQL Server are Access objects. So although you could use ADOX code to create links, the code presented in this chapter uses DAO.


I want to put the attached code in a module and call it using an autoexe macro at start , now can somebody help on the following items within the code:

(1)      Set tdf = db.TableDefs(LinkedTableName) How to list 120 tables here, show me an example ??
(2)      db.TableDefs.Delete LinkedTableName (What do I put here? Any example)
(3)      Set tdf = db.CreateTableDef(LinkedTableName) How to list 120 tables here, kindly show an example
(4)      tdf.Connect = ConnectionString  (Is it the ODBC with Less DSN File string????)
(5)      tdf.SourceTableName = SourceTableName (How to list 120 tables here, kindly an example??????????)


Public Function LinkTableDAO( _
LinkedTableName As String, _
SourceTableName As String, _
ConnectionString As String) As Boolean
‘ Links or re-links a single table.
‘ Returns True or False based on Err value.
Dim db As DAO.Database
Dim tdf As DAO.TableDef
On Error Resume Next
Set db …
0
Hi Experts,

We have data in Caspio that we are trying to export.
When we export them to Excel or CSV they work.
However when we export them into Access, some records fail.
This is what their support team responded...
“Despite of Microsoft's declaration that record row in MS Access is limited to 4000 symbols excluding Text64000 fields, this is not exactly true. If you download attached package, import it and open table in datasheet then add at least 1 symbol into TestColumn3 field (which is Text64k) you will not be able to download table in Access format anymore. Without this symbol it will work fine. In addition metadata of table is also present in some way in the record row so if you add any new column into attached table you won't be able to download it either. There is nothing developers can do with it as it's a Microsoft bug and beyond our reach. If you move the database to SQL there will not be any issues.”

Have you had any experience like that?

What do you suggest I do in order
1- figure out what is causing those records to fail.
2- fix/avoid it in the future.

Thanks
0
I have a c# application writing into a postgresql database through a stored procedure.

I have 2 input parameters  and 2 output parameters

I need to be able  to get the 4 (2 input and 2 output)  into some screen variables

The  scrip that runs the stored procedure is shown below;

        public void SelectUserProfile(UserProfileModel model)
        {
            using (NpgsqlConnection conn = new NpgsqlConnection(pgrstring))
            {

                using (var command = new NpgsqlCommand("public.spuserprofile_select", conn))
                {
                    conn.Open();
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new NpgsqlParameter("usercodex", NpgsqlTypes.NpgsqlDbType.Varchar) { Direction = ParameterDirection.Input, Value = model.usercode });
                    command.Parameters.Add(new NpgsqlParameter("passwordx", NpgsqlTypes.NpgsqlDbType.Varchar) { Direction = ParameterDirection.Input, Value = model.userpwd });
                    command.Parameters.Add(new NpgsqlParameter("groupcodex", NpgsqlTypes.NpgsqlDbType.Varchar) { Direction = ParameterDirection.Output, Value = model.groupcode });
                    command.Parameters.Add(new NpgsqlParameter("companycodex", NpgsqlTypes.NpgsqlDbType.Varchar) { Direction = ParameterDirection.Output, Value = model.companycode });

                    string var01 = model.companycode;
                    string var02 = …
0
Suppose I have a City which is divided into districts.
 

I have a database table  which is named "City". It includes the id of the district, and last names of people in the district.
As you can see in the sample table the last names occur more than once, as there are many people in the city with the same last name.

What I need is a query which will display the data broken up into the CityId, the DistrictId, and the unique last name of each person in each district. Note that the count of a last name should not occur more than once. So if the same district has 10 people with the last name of "Brown" that name should not be counted more than once. Also if the name was already counted in another district, is should not be counted again in a different district.

City Table :
CityId  |  DistrictId | FamilyName
----------------------------------
Austin  |  1          | Brown
Austin  |  1          | Brown
Austin  |  1          | James
Austin  |  1          | Maroni
Austin  |  2          | Maroni
Austin  |  2          | Trevor
Austin  |  2          | Jones
Austin  |  3          | Brown
Austin  |  3          | Greyson
Austin  |  3          | Maroni
Austin  |  3          | Nantula


Query result :

Austin | 1 | Brown
Austin | 1 | James
Austin | 1 | Maroni
Austin | 2 | Trevor
Austin | 2 | Jones
Austin | 3 | Greyson
Austin | 3 | Nantula

I have a sql query which will return the correct result in sql server, but it will not work in Sybase, because Sybase…
0
Hi Experts,

I have the following query that compares two lists (in different formats) and gives the unmatched records.

SELECT   distinct v.*,replace(convert(varchar(5),V.Schedule_ScheduleStartTime,108)+'-'+convert(varchar(5),V.Schedule_ScheduleEndTime,108),':','')
FROM V_TestHHASchedule AS V
WHERE   not Exists (SELECT NULL FROM [VisitReport] R 

                       where 
                       replace(RTRIM( LEFT( r.PatientName, CHARINDEX( ' (', r.PatientName + ' (' ) ) ),' ','') = replace(isnull(Patients_LastName,'') + isnull(Patients_MiddleName,'') + isnull(Patients_FirstName,''),' ','')
                       and replace(RTRIM( LEFT( r.aideName, CHARINDEX( ' (', r.aideName + ' (' ) ) ),' ','') = replace(isnull(Caregivers_LastName ,'') + isnull(Caregivers_MiddleName ,'') + isnull(Caregivers_FirstName,''),' ','')

                        and datediff(d,V.Schedule_VisitDate,R.visitdate) = 0

                        and replace(convert(varchar(5),V.Schedule_ScheduleStartTime,108)+'-'+convert(varchar(5),V.Schedule_ScheduleEndTime,108),':','') = R.scheduled
                       
                      
                      

)
and v.caregivers_lastname <>''
order by v.patients_lastname,v.patients_firstname, v.schedule_visitdate ;

Open in new window


I have some records showing up that cant figure out why.

Looking for some tips...

Here is an explanation of what the query supposed to be doing...
https://www.experts-exchange.com/questions/29126893/Query-comparing-two-tables-with-different-format-needed.html?headerLink=workspace_answered_questions

Thanks
0
UPDATE:  Added the 'which' columns to the query.

Database comparison of two tables.

I'm looking for a query that will compare two databases with identical schemas.  Here is a simple query that I've written:

select *
from
(
  select 'db1' as which, a, b, c
  from db1.tbl where attrib = 'test'
UNION ALL
  select 'db2' as which, a, b, c
  from db2.tbl where attrib = 'test'
)
group by a, b, c
having count(*) = 1
order by a, b, c

Open in new window


This will show the row differences but does not tell me which database a row as added to (db1 or db2). [UPDATE: added which so I believe I can see which db row was added to]
It will show if two rows differ but does not tell me specifically which column data was changed.
Also, when a row is delete from one of the dbs, it does not tell which db is was delete from (db1 or db2). [UPDATE: added which so I believe I can see which db row was delete from]

And the above query be amended support the three items?  I'm using SQLite (an older version) so I don't have the flexibility of stored procedures or functions.  Another possibility is to solve this using JavaScript.  I'm aiming for short and simple.
0
I have read from a few 'best practices' guides that every SQL Server administrator/DBA should configure their production instances to alert on any events with "severity levels 19 through 25". However, I am trying to grasp exactly what those events relate to, and translate that into something meaningful to senior management as to 'if you dont get alerts on these events - this could be the consequences... for those who do use SQL alerting, do you capture these events, and to be blunt "why"?
0
Big Business Goals? Which KPIs Will Help You
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

I have inherited a very old and poorly written stored procedure with nested fetch statements. This code processes a large amount of data by copying from one database into another. This process was working fine until updates were made to indexes. This past weekend the process was deadlocks on tables and failed to insert data. Added to this bad stored procedure the database we are inserting into is loaded with multiple triggers on just about every table.

I have reverted the indexes back to where they were but the inner fetch stays in an infinite loop. We have also tried rebooting the server to clear out any data stuck in memory. We are running SQL Server 2008R2

I can provide code if needed. Any help is greatly appreciated. We are impacting production at this point.
0
Unique Key Constraint Problem - MySQL, SQL Server, Oracle, Postgres

Assume i have a employee table which has 10 columns and have to create a unique key constraint for id, name, address, mobile

In the above case address might can come as null and mobile can come as null. However when they comes the uniqueness should be maintained.

first, i created a unique constraint by combining all the above keys and following is observed.

Actual Behaviour in MySQL.

   001-Thiagu-NULL-900000 - Accepted
   001-Thiagu-NULL-900000 - Accepted
   001-Thiagu-0001-900000 - Accepted
   001-Thiagu-0001-900000 - Rejected - Duplicate Record

Expected Behaviour in all the Databases

   001-Thiagu-NULL-900000 - Accepted
   001-Thiagu-NULL-900000 - Rejected - Duplicate Record
   001-Thiagu-0001-900000 - Accepted
   001-Thiagu-0001-900000 - Rejected - Duplicate Record

Basically the similar should be considered for duplication no matter whether the value exist as NULL or Not.

To overcome this problem i dropped the idea of combining and creating unique by adding colums to the unique constraint and come up with a new column of string type with unique constraint.

One each insert of the record i manually construct and give the value on any insert so that uniqueness will be maintained.

Is that would be the right approach or any other way to fix in the above first approach which i am not sure.

The constraint should work in all databases.

Please kindly help on how to …
0
Table Name: Audit
Column name: CreatedON datetime

I am looking way to find the count of records that are created in every 30 minutes based on CreatedON column. At the end of the day i will run T-SQL select script and I need output like below.

Case_Count                CreatedON
10                               12/12/2018 9:00:00
12                               12/12/2018 9:30:00
18                                12/12/2018 10:00:00
.
.
.
.
200                          12/12/2018 23:30:00

Can help me how to accomplish above task using T-SQL script.
0
In MS Access VBA I am using TransferSpreadsheet to import raw data in preparation for purifying it and applying it to a table in the live database. The source worksheet always contains some rows of good test results of Radon in air or Radon in water. But it also always includes some 'junk data', specifically unused columns with #DIV/0! in the Results column. The TrasnsferSpreadsheet function cheerfully creates a Sheet1$_ImportErrors table listing all the divide-by-zero rows.

After a while there is a large number of such tables. So immediately after Sheet1$_ImportErrors is created, I would like to find it and delete it.

Here is the function that is doing the import.
Public Function GetRnWaterRaw (inToTable As String, inFullFilename As String) As Boolean
On Error GoTo HandleError
    
    DoCmd.SetWarnings False
    DoCmd.OpenQuery "qdelEmptytblFromRnWaterRaw"
    DoCmd.SetWarnings True
    DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, inToTable, inFullFilename, True
'   Add new code here to delete the newly-created Sheet1$_ImportErrors table[embed=file 1406810][embed=file 1406811]
    GetRnWaterRaw = True

ExitProc:
    Exit Function
HandleError:
    GetRnWaterRaw = False
    MsgBox Err.Number & " " & Err.Description & " in GetRnWaterRaw", vbOKOnly + vbCritical, ModName
    Resume ExitProc
End Function

Open in new window



Can someone provide or point me to an example of VBA code that will check to see if the Sheet1$_ImportErrors table exists and proceed to delete it.
Import-target-tables.png
ImportErrors-tables.png
0
I want to create a website that would list a description for each of around one thousand textbooks.  I work at a University, so it is an educational project, purely for information for other faculty and students.  The textbooks themselves are located at multiple universities around the world, I am just going to link to them and describe them.

I would create a database (in Maria DB, probably) with the following fields:  Title, URL, Author, Author's credentials, Year of Publication, Number of pages, Type of license, Subject, Reviews & Ratings.  It would be great if visitors could a) search by keywords and b) filter the lists of books to find, say psychology only titles.

What is the path of least resistance for me to create a simple website like this? I have a couple of LAMP and XAMPP servers running pre-built solutions like a institutional repository or an open journal system.  Is there another pre-built product I can use?  If not, what would you suggest?
0
I'm using the Employees and Orders table in the Northwind sql server database.

Employees table looks like this:

Table_Employees.PNG
Orders table looks like this:

Table_Orders.PNG

Here is the script for the Employees table:

USE [Northwind]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employees](
	[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
	[LastName] [nvarchar](20) NOT NULL,
	[FirstName] [nvarchar](10) NOT NULL,
	[Title] [nvarchar](30) NULL,
	[TitleOfCourtesy] [nvarchar](25) NULL,
	[BirthDate] [datetime] NULL,
	[HireDate] [datetime] NULL,
	[Address] [nvarchar](60) NULL,
	[City] [nvarchar](15) NULL,
	[Region] [nvarchar](15) NULL,
	[PostalCode] [nvarchar](10) NULL,
	[Country] [nvarchar](15) NULL,
	[HomePhone] [nvarchar](24) NULL,
	[Extension] [nvarchar](4) NULL,
	[Photo] [image] NULL,
	[Notes] [ntext] NULL,
	[ReportsTo] [int] NULL,
	[PhotoPath] [nvarchar](255) NULL,
 CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED 
(
	[EmployeeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
SET IDENTITY_INSERT [dbo].[Employees] ON 

INSERT [dbo].[Employees] ([EmployeeID], [LastName], [FirstName], [Title], [TitleOfCourtesy], [BirthDate], [HireDate], [Address], [City], [Region], [PostalCode], [Country], [HomePhone], [Extension], [Photo], [Notes], [ReportsTo], [PhotoPath]) VALUES (1, N'Davolio', N'Nancy',

Open in new window

0

Databases

57K

Solutions

40K

Contributors

Databases are organized collections of data, most commonly accessed through management systems including schemas, tables, queries and processes that allow users to enter and manipulate the information or utilize it in other fashions, such as with web applications or for reporting purposes.