How to navigate XAMPP/myPHP and verify if mySQL is functional? - xampp

Recently downloaded XAMPP on Windows and I would like to request a tutorial on how to navigate the program. I'm not sure how to open myPHP and test SQL Queries or create databases. Any help would be appreciated.

Welcome to XAMPP,
By now you should have the program installed in the location of your choice from the Apache friends website. I understand that it is quite difficult to get started on a new project utilizing unfamiliar tools, by the end of this short tutorial you can start building all sorts of ideas!
1. To start, open the application from the desktop. On windows, the opening screen will display as shown below. Click on "Start" for the Apache and MySQL modules.
Homepage of XAMPP
The port value will be 80 for Apache in most cases, this varies dependent on module type and other applications with respect to their assigned port numbers.
These can be viewed by navigating to "Netstat" which displays socket properties. Configurations can be completed under "Config" in the top right of the application and under "Service and Port Settings". Common issues to modules not working correctly is due to port error or overlapping and changing values will prevent this.
2. The status of the modules is portrayed in the panel below. In your preferred internet browser, type "http://localhost". The dashboard of Apache with given instructions will show when entered. Navigate to "PHPMyAdmin" at the top right of the webpage.
PHPMyAdmin
The critical step for this dashboard to be functional is to have the MySQL module running. On the left of the screen, databases are displayed when created.
3. Next, type "Create database test;" in the SQL tab queries text box. The console is displayed at the bottom of the page representing errors and program messages. Click the "Go" button. The "test" database will join the list of databases on the left side of the window.
This verifies that MySQL and Apache servers are functional on the local computer. URL's define locations for pages that are requested and identify webserver addresses. Apache is an application that provides access to these requested locations to the user.
4. A simple webpage can be generated by the user through XAMPP. Create a .txt file with its contents only including "<h1>StackOverFlow</h1>" and under this type "<p>I am learning, this is a test</p>". Save this file in the htdocs folder inside the xampp installation location as "StackOverFlow.html". Go to your browser and insert "http://localhost/StackOverFlow.html".
The process listed allows the browser URL to request the existing web server to obtain the page's contents "http://localhost/StackOverFlow.html"
5. Next, go back to step 3 where queries will be used to construct tables for relationships of entities and test values.
The test database was created previously and still exists. Keep the query tab open and edit the initial script to be "create database if not exists test;". Add the statement "drop database if exists test;". These steps permit the program to refresh the database and scripted queries each time the user clicks "Go" resulting in the removal of overlapping data.
Two tables will be created and their relationship can be expressed shortly. In the next step, a simple Company and Product association is used. Basic terms to know to write SQL queries:
SELECT -> extracts data from a database
UPDATE -> updates data in a database
DELETE -> deletes data from a database
INSERT INTO -> inserts new data into a database
CREATE DATABASE -> creates a new database
CREATE TABLE -> creates a new table
DROP TABLE -> deletes a table
VarChar -> Varying variable character of desired length
Char -> character of set length
Not Null -> term cannot be null
Date -> date term reference
Integer -> term must be an integer
Key -> uniquely identifies row(s) in a table
SQL Syntax
6. Insert "use test;" under the creation of the database query. Then structure the code in an organized fashion for easy reading for the user.
Add "create table Company(" and under insert "companyName varchar(40) not null primary key,", then "street varchar(40),". Also, "city varchar(40)," and "province char(2)," with "postalCode char(6));".
Add "create table Product(" and under insert "producedBy varchar(40) not null,", then "dateMade date not null,". Also, "productName varchar(40) not null);".
The Company and Product tables are now created with specific dimensions, ordering, and terms.
7. There are many types of relations within SQL that allow individuals to retrieve specific data, store, and construct relationships between many tables with set parameters through additional queries. This example is simple where producedBy references the companyName containing relevant data.
Position the following below both the table queries:
Test values for Company table
Test values for Product table
Select "Go" and this will create tables that can be viewed by clicking the database "test" on the left side.
Here, the statement INSERT INTO is used to input the data below into the table with the parameters created. Appropriate ordering of data from first to last must match with the corresponding table. Invalid inputs will result in the console returning an error. Selecting specific data from a larger database with numerous tables can be accessed by "SELECT * FROM TABLENAME", creating temporary relations and returning desired data. This concept can be further discussed in another tutorial. The interface is extremely useful and can be implemented within html websites to store, calculate, or retrieve data/user processes.
XAMPP is an exceptional tool to create and integrate into different areas of development, I would recommend taking a look at "https://www.w3schools.com/" to further learn SQL, HTML, and other skills to extend your range of capabilities.
Thank you for going through this tutorial! If you have any questions feel free to leave a comment.

Related

Oracle Apex 19.1 (how to add, edit, delete data through a form)

I'm new to oracle apex so this might be simple.
I have an application that i'm currently building. I have an 'employee' table in the SQL workshop. When i attempt to create a form linked to the table there is no option to edit, delete, or add entries into the table ,once the form is completed?
This is essentially what i need help with. I need to be able to manipulate the 'employee' table through the form created rather than through anything within the sql workshop. Just for context i am not the workspace admin, however i am a contributor.
I would appreciate if anyone could provide me with a quick step by step guide into creating this desired form accurately.
I'd suggest you to create (using the Wizard, of course) Report with Form on Table. It will create
interactive report you'd use to view data stored in that table
form which will be used to insert/update/delete data
the same form will be called when you push
the "Create" button in order to create new rows, or
icon at the beginning of every line in the report in order to update/delete rows
This combination (report + form) works nicely for ages, so ... try it. I hope you'll find it useful.

Redshift View keeps reverting to previous definition

I created a view in Redshift that unions two queries, and it works great. We've thought of a third query that would be worthwhile to add in. eg
CREATE VIEW stem_alumni as
SELECT name, email
FROM students
WHERE graduated < 2019 AND major = 'Engineering'
UNION
SELECT name, email
FROM alumni
WHERE current_employer = 'Google'
The problem is when I try to add a third query in
UNION
SELECT name, email
FROM professors
WHERE department = 'Engineering'
it'll persist for maybe an hour, but then revert to just the original query.
I've run CREATE OR REPLACE VIEW... and dropping/recreate and get the same result.
How do I get an updated view definition to persist?
Adding more context
I created the view using DBeaver, a local SQL client using my specific Redshift credentials. The view is called by Periscope, our cloud-based BI tool using shared credentials. Querying the view in Periscope or separate DBeaver windows will eventually revert the view to its original definition.
Redshift shouldn't have a 'memory' of the view's prior DDL that it could revert to. I'm inclined to agree with the comments that something else is overwriting the updates to the view's DDL after you have committed them.
You should be able to see if something is overwriting the view, by querying the stl_query table:
SELECT q.starttime
, u.usename
, q.querytxt
FROM pg_user u
JOIN stl_query q ON u.usesysid = q.userid
WHERE POSITION('<view_name>' IN q.querytxt) > 0
ORDER BY q.starttime DESC
;
This table only contains recent query information (2-5 days according to the Redshift Documentation), so if you haven't experienced this behavior from the view within that timescale, you may need to force it to occur again in order to troubleshoot who/what is altering the DDL.
Additionally, if the view is being overwritten by a user other than yourself, you will need to query stl_query using a super user account (by default, non-super users will only be able to view information for queries that they themselves have executed).

What determines default Interactive Report column layout in Oracle APEX 5?

I have an Interact Report page in Oracle APEX 5 that includes a SQL Query with ~10 columns or so. When I first load the report, the columns are in a certain order, and columns are set to Do Not Display (as seen under Actions -> Select Columns). The default order does not seem to match the order in which I list them in the SQL Query, nor does it use the order that is found in the Page Designer, under {Page Name} -> Regions -> Content Body -> {Interactive Report} -> Columns. I have two questions about the way columns are displayed in the Interact Report component:
What determines the default order of these columns?
What determines which columns are set to Do Not Display and those set to Display in Report?
Are those settings saved for each user?
First of all, you should probably take a good look at the documentation. Plenty of useful things. The main thing you're looking for in this case would be about saving interactive reports.
In short though.
When first having created the IR the columns will be in the same order as in the select statement.
Afterwards, there is no longer a relation between position in the select statement or the order of the columns as seen in page designer.
Instead, the initial order has been used to create an initial Primary Default report.
From this point on, column position and being hidden or display solely depends on the settings in the "Select Columns" menu.
If you want to alter the default offered to the end user, you'll have to run the page, alter the IR, and save your settings through Actions > Save Report and selecting Primary Default.
Settings saved for each user? Yes and no. End users will be offered the primary default at first. If multiple defaults are present the application will remember which one they have last been working on when coming back.
Users can also save private versions of reports, or public ones, if enabled. They can then edit the report settings, but these settings only affect their own report in that same session. If not saved, all changes they made settings-wise are lost and they'll be presented with the defaults again next time they log in. (or perform a reset themselves).
Unless you take all control away of course, by configuring the Actions menu of the IR.
I was hoping to edit saved reports in the Application Builder, but I guess this is not available (at least in 5.1 that I'm using).
This helped me:
SELECT FLOW_ID, PAGE_ID, REPORT_ALIAS, STATUS, IS_DEFAULT, DISPLAY_ROWS, REPORT_COLUMNS
FROM apex_050100.WWV_FLOW_WORKSHEET_RPTS
WHERE FLOW_ID = 101
AND page_id = 25
;
Then I edited that table updating columns list or other attributes of the saved report.

Saving copy of old table entry to another table when updating table entry with SaveChanges()?

Im working on an online store project where I have already made it possible for an administrator to update different table entries via the store gui (like items, user profiles, orders etc). SaveChanges(); is used to save the changes.
Im currently trying to figure out how to make this work:
An entry in table "items" gets updated.
Before the entry in the table "items" gets updated, a copy of the old entry gets saved into a table named "history-items".
The copy that is saved to "history-items" preferably has a timestamp.
How would I go about doing this? (As you might tell, I just recently picked up visual studio, and am pretty new to everything)
Thank you.
There are atleast 3 ways to do this:
If you are using SQL Server 2008 or newer this is now built in functionality, see: http://msdn.microsoft.com/en-us/library/bb933994.aspx
If you opt not to use that then the simplest solution is to use database triggers.
If you want to do it in C# code, then you need to read the original values before saving, and save these original values to the history table. For reading original values see: How to get original values of an entity in Entity Framework?
I would go for option 1 if possible.

TCR 2.1.1 importing ITM reports

I am trying to run some reports in TCR I imported from the 6.2.3-TIV-ITM_TMV-Agent-Reports-FP0001
Seeing that I get this error: UDA-SQL-0196 The table or view "KSY_SUMMARIZATION_CONFIG_DV" was not found in the dictionary.
I checked and the table is not in the database.
Seeing that regarding that table it says this:
The Summarization and Pruning configuration is shown in a specific query subject (Summarization and Pruning Configuration). The result is one row that represents the most recent entry in the KSY_SUMMARIZATION_CONFIG_DV view.
Maybe the WAREHOUS is lacking something? If the agents are running shouldn't there be a view named KSY_SUMMARIZATION_CONFIG_DV?
I don't seem to find other tables like: KLZ_CPU_HV, KLZ_CPU_DV, KLZ_CPU_WV, KLZ_CPU_MV,
KLZ_CPU_QV, KLZ_CPU_YV
Thanks for your help
You have to configure historical collection for the appropriate agent attribute groups for those tables to show up in your TDW. For instance create a historical collection for the "Linux CPU" attribute group to get the KLZ_CPU table. For tables ending in _D, _H, etc, configure hourly, daily, etc, summarization for those attribute groups.
Depending on collection intervals eventually the warehouse proxy agent will create the necessary tables.

Resources