Kevin Powell - Community

KPC

Kevin Powell - Community

A friendly place for developers to meet other devs, ask questions, get help, and just have a good time 🙂.

Join

front-end

resources

back-end

ui-ux

os-and-tools

PHP Catalog Limit Numbers of Items per page

Hello, i managed to understand how to generate divs from the numbers of row into an database. I can't figure out how to limit the amounth of items per pages just like in a normal ecommerce shop. You can navigate to page 1,2,3 etc. In my code it just spams each row into the page. I want 10 elements per page, then change page 2, then 3 etc. I am newbie, i don't know even if i am doing this div generations corectly. And yes i know i have to use prepared statements for sql, but is easier to work with it like this. This is the code i wrote: $sql = "SELECT * from prodotti";...
No description

sockets issue

I got issue with the sockets not broadcasting the message to the frontend so If you know how to fix it please help

"CORS" issue with MongoDB

Hi Hi, Does anyone know how to get rid of the "CORS" with MongoDB? I think my function is correct as it works when I disable the "cross-origin restrictions" from safari. Here is my function: ...
No description

Instagram clone | How to handle stories being visible only for 24h?

Title says it all. How would you handle Instagram stories being visible only 24h after being posted? I'm working with mongooose. I found there is an expires option available in second parameter of mongoose.Schema(): ```js import mongoose from 'mongoose'...

Local Storage Usage In React Using Axios

Hello, guys. Currently learning backend. I would like to as if my given code snippet is syntactically correct for storing user data from the database to local storage in react js.
No description

In Search of MySQL Workbench Projects with ER-Diagrams for Upcoming Presentation

Esteemed colleagues, I trust this message finds you well. I am reaching out with a specific request for assistance that pertains to my upcoming presentation. I am currently in search of valuable resources related to MySQL Workbench projects, particularly those accompanied by ER-diagrams. If any of you could kindly guide me towards videos, links, or readily available projects that align with this requirement, I would be immensely grateful. The information will play a crucial role in enhancing the content of my presentation, scheduled just a few days from now....

Headers already sent error PHP form

Why this form is causing "headers already sent error": ```html <div class="form-container upload"> <form class="default-form upload" action="upload-game" method="post" enctype="multipart/form-data"> <label for="title">Title: </label>...

Is there a way to reinitialize jQuery?

I'm trying to get some help on this stackoverflow question I wrote: https://stackoverflow.com/questions/77602661/is-there-a-way-to-reinitialize-jquery To summarize: I'm using JSDOM to load my webapp and my webapp uses jQuery. JQuery holds onto references of the current global window/window.document (this is an oversimplification and full details are in the question) once jquery is initialized. This prevents me from running tests that use different HTML and that is highly restrictive. I'm looking for a way to reinitialize jQuery in my test code so that I can use a different document per test. Is there a way to do this without modifying my production code that already import jQuery from 'jquery's? PS: Is this question more suitable for #front-end ? IMO, it's kind of both....

Should i learn PHP or ASP?

I started learning recently html, css and javascript basic stuff. I want now to start learning back end and try make an ecommerce site. I tryed PHP but i found it extremely hard and messy. The syntax i hate it, also is annoying with filtering variables to not run scripts inside and security. I managed to insert and read data into MySql database, but to make login, logout and session it kills my brain. I saw ASP.net and seems way much cleaner and easier to use. Should i let go PHP and go for ASP.net? What you recomand for a newbie in web development?...

include not working

I don't get it 😦 I'm using include for every page to get my server and my header. But on one reason doesn't work on this page… ```php...

Laravel

Hi people, I am a student of web development and recently I have invested a little more in my github and I follow a lot of the content of kevin and it is simply amazing, after some work on front-end I liked to create my first full-stack project that would be a kind of wine warehouse with database etc, in my course I have some knowledge with mySQL, PHP, but I would like to use this project laravel any of you have some council/ youtube channel etc who advises me where I can learn more about larava...
No description

SQL Table Definition

I'm trying to make a database for a TTRPG (Fate, if you're wondering and am trying to figure out how to handle one specific part of the database. Fate characters have both stress (plot armour) and consequences (long-term harm). My issue is that stress is a numeric (a character has X number of stress boxes) and consequences are textual (it's a short phrase describing the injury). I currently am thinking that I need 2 tables: one for stress and one for consequences (as their enherit datatypes are different) but is there a way to have one "vitals" table (the term used on the character sheet for both stress and consequences) so I don't need to do too many joins (I already have a table for skills, aspects, stunts, and basic character stuff like name, etc)....

Prevent spamming of api calls when Refresh is pressed or back + forward continuously

What I need to do is store the user's results of the first call and then either cache or localstorage / sessionstorage so when the user presses the buttons mentioned above, the page will load that data instead of doing multiple calls. I also need a timer to do another call after an hour to update for any weather changes. Any ideas on this?

mongodb

Just want to ask some question , can we implement all the basic features of an e commerce delivery backend just via mongodb queries and aggregation pipeline ( db is mongo) , just asking coz i am facing difficulties in aggregation pipeline.

how to publish asp.net project with sql server to godaddy

how can i publish asp.net project that is connected with sql server on godaddy so that database functionality and operations work perfectly.

Mastercard mpgs integration with wordpress donation website

Hello friends, I am having really hard time with integrating my donate button on my wordpress template with mastercard mpgs, so that any user can donate using mastercard API. Can someone please give me a hint?...

Jest for testing?

What are your thoughts? I guess it is good because it is what you use whit React as a default. Exicited to hear what you have to say.!...

Need Help for Database Structure

Hi folks! I'm building an Online Turkish Dictionary where I want users can contribute to the dictionary by adding, editing and maybe removing the words, meanings, pronunciations and so on. (using t3-create-app, app dir with drizzle and postgres) You can see the initial ER Diagram in the first picture. ...
No description

How to deploy your website without other users getting into your database user and password file?

Lets say I want to deploy a folder into github and it's connected to a database and I name it a file called db.php. Is there a way to make it so that when I upload this to GitHub, I can still connect to the database but other people cannot find the file? Dose the gitignore file dose that? I never thought about it until now....