Skip to content
Advertisement

Tag: php

Need to fix sorting order by name and price

I am working on school listing project. I have created database name is school and under I add new table name is schoollist Here I have many school. I have added few column on it bellow the list of column. For the above table i want to search Wright Oslo and after the result should be Wright oslo school and

How to show/fetch amount of posts, comments etc a user has made

I want to show the users the amount of posts, comments etc they have created in their profile section, just like any other forums that exist. I am doing this with php and MYSQLI. Post table: I have tried to add another column to the post table and increment its value by 1 each time the user makes a post

Sql list unregistered classroom

There is one student. This student is enrolling in classes. What I want is to list the classes where this student is not registered. My SQL query is like this. Where am I going wrong? Answer I had to assume your table structure and I hope I got it right. The classic approach would be with LEFT JOIN and IS

retrieve rows based on parent relationship

This is the query: I am trying to get all the checklist items that have the same item_stock_id from the checklists that have the same ambulance_id. However, the query from above is not working, showing me this error: Below is the ChecklistItem model: And this is the Checklist model: Answer To constrain the eager load you need to specify the

PHP login session not coming through (Login with SQL database)

The latest little ‘challenge’ I’ve made for myself is trying to code a good login screen on a site I’m making for some friends. However, when I input my email and password as they are displayed in my SQL database, the file I use to check it with does not send out anything at all. My code looks as follows:

NULL MAX(col) value even though DB has a valid record

So I am trying to extract the maximum invoiceNo for current year and this is how I implemented it with PDO: However, $response keeps getting assigned to the else clause : . This is how my DB looks like: Hence I was expecting the $response to be 2022-2. I think there is something wrong with my SQL query and I

Convert String containing commas to array

I am trying to convert a String to an array By doing so it gives me an error when trying to fetch data on MySQL However, if I manually set the array as $array = array(‘1’, ‘2’, ‘3’) it doesn’t give an error when fetching a data, is there a way to convert the string to the array so the

executing .py in html/php

I wrote a Python script which writes its output into a txt file. Then I included that file in my html/php website. – works good so far. Only remaining problem: I can’t execute the .py file automatically while opening the site. I know that this isn’t the best solution <?PHP exec(“python3 Auswertung.py”); ?> doesn’t seem to work Answer I used

Unable to filter SQL data from last 30 days

I want to collect data from SQL from the last 30 days. This code shows data of all time this shows nothing, instead of showing last 30 days data. All SQL entries were made within the last 30 days. also tried What am I doing wrong here ? Answer Try this: The second doesn’t work because you put GROUP BY

Advertisement