I have created a database using SQL and I have a functional web page built on Angular and nodejs which is connected to the database. I need to make the search bar functional. How should I proceed? Answer Create a input box in html with keyup event as : Add this function in your .ts file which will be triggered
Tag: node.js
Display lookup/relational data in a v-data-table with Vue and SQLServer
I created a Node App with Vue.js, Vuetify (Client side of app) and Express (Server side of App) and the data is stored in a SQL Server database (relational database). Everything is up and running on …
One value for multiple placeholders in nodejs-mysql
To allow users to login using thier username or email OR phonenumber, I’m using this query: res.post(‘/api/userlogin’, function(req, res){ connection.query( ‘SELECT * FROM users WHERE …
How i take a value that is like field in my database?
I try to get values that contains words in my sql database. I try with “contains” but I get an error. I work with SQL This is my code: I have this error: UnhandledPromiseRejectionWarning: Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
Sequelize Include with Where Condition
I’m having a problem with how to query multiple include with where condition. Tried it using direct query to sql and it works fine. I made a sample using sql and having a problem converting it to …
How to retrieved parent object which haven’t children with specific values? Sequelize
Description & question Rentals is table with all registered rentals with start and end date as properites. After querying i want to get only this productGroups which have some products that don’t …
How do I populate a foreign key field with data instead of just foreign key id on select query?
I have 2 tables with class and subjects. class(id,name,student_count) subjects(id,name,class_id) I want to populate class_id with name,student_count, and id on the select query. How do I do this using SQL or Knex? I tried using join, but I get only one field not all fields in a row. The expected result would be: By the way, answer in Knex or
Graphql, node.js and sql,Cannot return null for non-nullable field
I want to return data coming from db to the api. The data is being logged but not showing on the graphql api. RESULT: OUTPUT: Answer This is your resolver: A GraphQL resolver must return either a value or a Promise that will resolve to a value. However, here, you’re not returning either. Keep in mind that callbacks are invoked
NodeJS MySQL apostrophe reduplication with INSERT query
I’m doing my project Nodejs and MySQL and I have some problem with query with apostrophe. I got all of the data from github api and it normally works fine. but If data have single apostrophe(‘), it …
Is escaping SQL queries like this safe?
I am currently working on a NodeJS backend script that parses incoming HTTP requests to write to and read from a MySQL database for work. I tried to protect it against SQL injections by using a kind of two-layer protection. To write to the database the user needs to provide valid JSON. This is how the JSON’s keys need to