Categories
Mastering Development

Error 1698: Access denied for user ‘root’@’localhost’ exit status 1 using GoLang

I’m making a REST API using GoLang and MySQL following this tutorial. This is my main_test.go file package main import ( "log" "os" "testing" ) var a App func TestMain(m *testing.M) { a = App{} a.Initialize("root", "admin", "rest_api_database") ensureTableExists() code := m.Run() clearTable() os.Exit(code) } func ensureTableExists() { if _, err := a.DB.Exec(tableCreationQuery); err != […]

Categories
Mastering Development

MYSQL Cant not create table errno: 150 Foreign key constraint is incorrectly formed

A problem occurred in the foreign key while creating a table with mysql workbench. When i create table with mysql workbench, workbench give me this error : Executing SQL script in server ERROR: Error 1005: Can’t create table kipit.unlike_game_library (errno: 150 “Foreign key constraint is incorrectly formed”) Executing SQL script in server ERROR: Error 1005: […]

Categories
CMS Magento Mastering Development

Custom module admin grid show blank page in magento 1.9

I have created one simple form on frontend that will submitted by customer and create one menu in admin panel to show only the grid for same, no add-edit form. When I click on the menu it will redirected to a page where header and footer are present but the content area is blank, No […]

Categories
Mastering Development

The increment size of the [employee_seq] sequence is set to [50] in the entity mapping while the associated database sequence increment size is [1]

I’m following the Learn Spring 5 etc on udemy and im at the part where we test our application. Everything worked fine till now, i was able to connect to the postgreSQL database and all but now im stuck at this test failing since 2 days. I dont understand what is causing the Test to […]

Categories
Development

Why is postgres in psql different from executing in php with pg_query [closed]

I am executing a postgresql in php with pg_query() but i don’t get the same result as when i execute it from the psql command line. “SELECT bidbond.com_name company_name, com_phone, com_address,org_name, org_address, project_title, bond_type, bond_amount, duration, duration_type, contract_sum, reg_date FROM bidbond INNER JOIN branch ON bidbond.insurance_branch_id=branch._id where user_id=$id” The above code executes alright on the […]

Categories
Development

Does ORM in Spring Data JDBC support JOINs when mapping entities?

I’m implementing one-to-many relationship using Spring Data JDBC (1.0.10.RELEASE), where i.e. one Customer can have many Orders. When executing JOIN query I can see in DEBUG that after performing JOIN query, there are executed additional queries for each Order by its ID to get order data which seems completely redundant. As a result when returning […]

Categories
ASP.NET Development MVC

I have an error on mapping data using dapper in asp.net C# MVC

This is the Error: CS1061 C# does not contain a definition for ‘Query’ and no accessible extension method ‘Query’ accepting a first argument of type could be found (are you missing a using directive or an assembly reference?) Here are my models public class TourPackage { public int p_id { get; set; } public string […]

Categories
Development

Error converting data type varchar to real

I built an INSTEAD OF trigger that supposed to start when I try to insert into a view of products that consists of 2 tables : Approved_Products and Products. My point is to reroute the insert and insert the data to the Approved_Products table. The data for the insert is coming from a CURSOR that […]

Categories
Development

DB Design Question about Nullable Foreign Keys and Normalization

I’m hoping to get a consensus about what db schema is best for my situation to store ‘type’ information for Widgets in a table. A Widget can have only one type but that type can be either a Preset-Type OR a Custom-Type. I obviously create the preset types and a user would create a custom […]