Basically, I am wanting to detect if a database column is empty or if it contains text. The text doesn't have to be a specific set text just text.
If the column is empty, then show a message in php.
I have tried to use the row in question but still learning php so not quite sure the way around this.
if ($row['insert_time'] contains "") then {echo "The row contains no text"};
If the column insert_time
contains no text, I want it to display "No Results" or something to let the user know there's no text.
If the column insert_time
contains text, then it will display the rest of the function I have found useful in my case.
I am connecting to the database using the following;
```
$link = mysqli_connect("localhost", "root", "", "chaotic");
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error() . " Please enter correct details in the install/config file.");
}
?> ```
The insert_time is however set for date and time, but with the database export file I was given to test with, contains 2 entries with no insert_time. So in future reference instead of PHP displaying it as an empty table row, I want to let user's know that the status is Unknown or similar.
What I also forgot to mention, is I am using a script from the web for "Facebook Time Ago" function, Its setup correctly but if the empty database column contains nothing, it automatically sets the table row to 46 Years.