Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

bcwp on "Displaying output from one table based on the info of another"

$
0
0

Glad we could help. With regards to output, in the examples you've provided so far you should be fine displaying the data exactly as it appears in the database (unless you need to reformat it for some reason).

Generally, you'd concern yourself with validating input before you save it to the database. In some cases a person might try to embed some malicious code (i.e., JavaScript) into a comment or post. This rogue input might pass your SQL injection filter but would be harmful if you output it to the browser of an unsuspecting visitor. So you'd need to come up with a filter or validation check that does more that just look for SQL injection attacks.

However it's difficult (or impossible) to detect every type of exploit you might encounter. So, in some cases it doesn't hurt to use some kind of output filtering (like htmlspecialchars or strip_tags) before displaying strings of user-submitted data. But things like dates, numbers, etc. should be fine as-is.


Viewing all articles
Browse latest Browse all 5527

Trending Articles