Click here to Skip to main content
15,888,908 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Is the James Webb Space Telescope now a planet? Pin
Chris C-B25-Jan-22 19:50
Chris C-B25-Jan-22 19:50 
GeneralRe: Is the James Webb Space Telescope now a planet? Pin
Cpichols25-Jan-22 11:10
Cpichols25-Jan-22 11:10 
GeneralCCC 25-01-2021 Pin
pkfox24-Jan-22 22:06
professionalpkfox24-Jan-22 22:06 
GeneralRe: CCC 25-01-2021 Pin
Randor 24-Jan-22 22:29
professional Randor 24-Jan-22 22:29 
GeneralRe: CCC 25-01-2021 Pin
pkfox24-Jan-22 22:31
professionalpkfox24-Jan-22 22:31 
Questionproblem Pin
diyan pabasara24-Jan-22 21:04
diyan pabasara24-Jan-22 21:04 
AnswerRe: problem Pin
FranzBe24-Jan-22 21:15
FranzBe24-Jan-22 21:15 
AnswerRe: problem Pin
OriginalGriff24-Jan-22 21:25
mveOriginalGriff24-Jan-22 21:25 
This forum is the wrong place to post this, as it says at the top of the page.
The right place is here: Ask a Question[^]

And don't do SQL like that: Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead.

When you concatenate strings, you cause problems because SQL receives commands like:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'Baker's Wood'
The quote the user added terminates the string as far as SQL is concerned and you get problems. But it could be worse. If I come along and type this instead: "x';DROP TABLE MyTable;--" Then SQL receives a very different command:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'x';DROP TABLE MyTable;--'
Which SQL sees as three separate commands:
SQL
SELECT * FROM MyTable WHERE StreetAddress = 'x';
A perfectly valid SELECT
SQL
DROP TABLE MyTable;
A perfectly valid "delete the table" command
SQL
--'
And everything else is a comment.
So it does: selects any matching rows, deletes the table from the DB, and ignores anything else.

So ALWAYS use parameterized queries! Or be prepared to restore your DB from backup frequently. You do take backups regularly, don't you?

But to be honest, the problem you have noticed is pretty trivial to fix: what should a line end with in PHP?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!

GeneralRe: problem Pin
g_p_l24-Jan-22 22:45
g_p_l24-Jan-22 22:45 
GeneralRe: problem Pin
Eddy Vluggen25-Jan-22 0:28
professionalEddy Vluggen25-Jan-22 0:28 
GeneralRe: problem Pin
trønderen25-Jan-22 1:02
trønderen25-Jan-22 1:02 
GeneralRe: problem Pin
OriginalGriff25-Jan-22 1:38
mveOriginalGriff25-Jan-22 1:38 
GeneralRe: problem Pin
obermd25-Jan-22 3:36
obermd25-Jan-22 3:36 
GeneralRe: problem Pin
OriginalGriff25-Jan-22 4:00
mveOriginalGriff25-Jan-22 4:00 
AnswerRe: problem Pin
dandy7225-Jan-22 4:32
dandy7225-Jan-22 4:32 
Generallookin for a note taking app (for windows tablet, with a pen) Pin
Super Lloyd24-Jan-22 11:31
Super Lloyd24-Jan-22 11:31 
GeneralRe: lookin for a note taking app (for windows table with pen) Pin
ElectronProgrammer24-Jan-22 12:57
ElectronProgrammer24-Jan-22 12:57 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
RickZeeland24-Jan-22 19:14
mveRickZeeland24-Jan-22 19:14 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
Super Lloyd24-Jan-22 19:22
Super Lloyd24-Jan-22 19:22 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
OriginalGriff24-Jan-22 20:59
mveOriginalGriff24-Jan-22 20:59 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
Super Lloyd24-Jan-22 22:07
Super Lloyd24-Jan-22 22:07 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
OriginalGriff24-Jan-22 23:17
mveOriginalGriff24-Jan-22 23:17 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
Super Lloyd24-Jan-22 23:34
Super Lloyd24-Jan-22 23:34 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
Member 1551036024-Jan-22 23:18
Member 1551036024-Jan-22 23:18 
GeneralRe: lookin for a note taking app (for windows tablet, with a pen) Pin
rnbergren25-Jan-22 3:26
rnbergren25-Jan-22 3:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.