Skip to content

Tag: sql

How to display query results in php

I know how to make a set query display, but I need to take an input, run a statement, and display the result. Here is what I have: HTML: PHP: I also want to make the statements read only so nobody can mess with my tables. im a little new to this i might need some extra explaining Answer To

How to handle True, False or NULL in where clause

How can I reduce this to only one where statement @state as bit I wish I could compare True, False or NULL in one select statement Answer Would this not work? Another approach would be to use coalesce on both conditions.

MySQL rows checksum

Is it possible to select entire row in a table and get sort of checksum? I am looking for a way to tell my code to update data only if at least one record has been changed. From perspective of data …

Check if NULL exists in Postgres array

Similar to this question, how can I find if a NULL value exists in an array? Here are some attempts. Only a trick with array_to_string shows the expected value. Is there a better way to test this? Answer Postgres 9.5 or later Or use array_position(). Basically: See demo below. Postgres 9.3 or later You can te…