Problem: My discord.js bot isn’t connecting to the mysql database on aws. The bot is being hosted on replit and also on heroku but for some reason I can’t connect to both. I have tried connecting to the database from my laptop and it worked fine, I even hosted the bot on my laptop to see if there was a
Tag: sql
Postgresql: How do I use dynamic values when searching jsonb array of objects?
I am currently trying to build a query for finding specfic object within a jsonb array. I have the following query which works fine if I used a hard coded string for the “game” value e.g. However, if I use a dynamic value like I currently do for username, I get invalid json syntax error. e.g. How do I search
Get ID and Value from a checkbox: Return to model and use in method to insert into sql database
I’m trying to create a checkbox list where a user is supposed to be able to choose one or more options, based on the choice: this is supposed to be inserted to a database table, where the id of the choice is inserted. (This is on a page where a user can “edit garage”), therefore the garageid is also supposed
performing select query inside checkout function
I have this function with the following code below: I’m basically checking how much the user owes to me, and then redirecting to checkout. However, it is totally skipping over the query and not logging anything, and then throwing the error that no price is defined. This is because I am trying to set the price after I query my
node js sql output
I am trying to come up with the node.js code to get the output of this query: The problem is that when I use it without the connection.escape(), I get the output, but with single quotes like this: How can I (1) get rid of the (index) column, and (2) get rid of the single quotes? Getting rid of the
Not return nested objects
I hav a problem with typeorm, I ahve na queryBuilder like below: why this query return me this data: instead of this: i need to return nested object instead of using alias, can someone tell me how to do this with using queryBuilder? thanks for any help! Answer You have to use getOne not getRawOne.
Javascript won’t work properly with my form
So I am currently doing a project for our class, in which I have to display something that I previously stored in a database on a separate page. I chose to display every dataset, as it is the easiest to do. With PHP I implemented a foreach loop which is supposed to show each dataset with a button “EDIT” underneath
i want to send a javascript prompt answer to my sql databse, is this possible or is there a better way to do this? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question currently have this code activated by a html button: i wanna send the value of group in a sql query
TypeOrm: Selecting results that contain all values in array
I am having some trouble getting the data I want from a Typeorm query. Basically, we have a search bar for the users to search our database of products (medicines). I want to select all records from the database that include every word the user entered. (These words are split into an array of values.) It might not be a
Inserting parameters of stored procedure into a table using Merge in snowflake
I am trying to insert the parameter values of a stored procedure into the table using merge function in sql. The parameters consists of DB and schema name. I have written a stored procedure for that but, I don’t understand where I’m doing wrong. Here is my attempt: Answer You can use binds: See https://docs.snowflake.com/en/sql-reference/stored-procedures-usage.html#binding-variables for more info.