Skip to content

I want to echo all classNames that have the same userid in php

code here : I am trying to echo all instances where the userId in the classrooms table is equal to the session userId. HELP. this is the table that we are using to track the users classrooms I’m using mysqli. Turns out, my post is mostly code. So let me give some background details. I’m trying to …

How to merge columns and transpose in SQL?

I’m working with a custom DBMS (compliant with SQL 2011 Standard), and am trying to combine multiple columns into a single column like so, but am struggling with the syntax: Current table: Desired query output: I’ve tried various IF and CASE statements, but have hit a wall. Any help would be appre…

SQL Query, loop through data

I have a database with the following fields: UserID, DateRecorded and Score. A new entry is added to the table each time the score is updated. Here is an example of a user record: From the query I would like it to show me only the scores of all users with the earliest DateRecorded. Although not much familiar …

SQL Server 18 – merging dates around midnight

I would like to ask if anyone could help me with this. I have a table with user traffic on websites. The important column is Timestamp which looks like this. Timestamps are used to calculate sessions. An hour or so in timestamps means one session. The problem is that calculated session is different when the a…