Skip to content
Advertisement

Tag: mysql

Redirect based on the ?id= parameter in the url

I have a login system that I build in PHP and MySQL. if any of my users log in they get directed to the user.php page I have an authenticate.php page that redirects the user based on their ID to a page. This is the code that adds the id to the URL: header(“Location: user.php?id=”.$id); ) Can I write a

How should I insert data to MYSQL database from a HTML form?

I know that node runs on the backend and while it’s not a problem to connect to the SQL database via the server.js file, I cannot understand how I could do that from within a js linked to a form element (that’s definitely client-side js, and I cannot make the connection from inside there). I know this maybe confusing, so

How to connect db ID to a db Value in javascript?

So I got a function that executes every X minutes/hours, when it executes it will select a random database array value, when it does, the selected will get + 1. Selected stands for the amount of times the row has been selected. This is my code from which I catch all of my database values Lets say if we have

how to insert array of data per column in MySQL?

I have arrays stacked in 1 array and I would like to insert each array per column in MySQL. I have reached to insert all data in arrays to 1 column, but I want to insert an array per column. Please see the screenshot and code below. Image of array stack Answer I just found a solution for this case.

Advertisement