Skip to content
Advertisement

Tag: mysql

How to get entry from MYSQL depending on the entered url?

What I want to achieve is something like Wikipedia is using: You enter “wikipedia.org/wiki/Stack_Overflow” into your browsers search bar and wikipedia shows you the article for “Stack_Overflow”. I know I could do something using php’s GET and www.website.com/article.html?article_name but I’d like to know how wikipedia’s solution works. Answer You need to rewrite ALL to index.php or router.php. So in your

Method returns undefined the first time it is called

I have a method that selects distinct values from a database as shown below: I then have a button with the method POST and action /categories The displayCategories is called when the button is clicked as follows: I added some console logs for test purposes. The issue I am having is that the first time I click the button, it

session value is not stored properly

I am using express-session and express-mysql-session in my app to generate sessions and store them in mysql database. Sessions are stored in a table called sessions. Sessions are stored in table but the value of it is not as same as the session value in client-side or console. Example: decoded value in client-side and console is s:fiNdSdb2_K6qUB_j3OAqhGLEXdWpZkK4.eKUawMNIv7ZtXSweWyIEpfAUnfRd6/rPWr+PsjuGCVQ, However the value

Display data after user input form (mysql-nodejs)

I have a page where there is a form, in which user will fill inputs. Then, I redirect to another page in which depending on the user’s choices some data will be displayed (the data will come from a mysql database). This is my code: index.js (here are my routes) airTicketsController.js (a controller where mysql queries will be executed) air_tickets.ejs

Advertisement