Skip to content

Tag: php

How can I echo the position number of SQL row in PHP?

Before you misread the title… I’m not asking how to echo the number of rows, I’m simply looking to find the position that the row is in. Let’s say we have five total rows: Now I’d like to get the position of the row that contains the post ID of 718. From looking at the data, we c…

Eloquent hasMany doesn’t load collection

I’m relatively new to eloquent, and have problems loading data from a hasMany relation in an app that uses eloquent as the database layer. My (simplified) code is as follows: The SQL Schema is like below I then do the following query: This results in a json like the following Raw SQL query shows me that…

Problem with identifying index in php html

My website must consist of a page with table where admin must upload some file. Later that file is saved by php as a blob in mysql, however, $_FILES cannot find and index of my file input. Please help finding a mistake. PHP code Answer Apart from security flaws in your code you are missing enctype=’mult…