Portal Home > Knowledgebase > Articles Database > Getting an unexpected T_ECHO syntax error and cannot understand why
Getting an unexpected T_ECHO syntax error and cannot understand why
Posted by FinalFrontier, 11-15-2011, 02:49 AM |
Can anyone see a problem with this combination of PHP/MySQL code? I am getting an unexpected T_ECHO syntax error and cannot understand why:
|
Posted by Grumps, 11-15-2011, 03:35 AM |
echo is not a function. It's a construct that outputs stuff.
Therefore, your code makes no sense.
|
Posted by foobic, 11-15-2011, 03:38 AM |
Or to put in another way, echo doesn't return a value so you can't use it on the right side of an assignment. I guess you want:
etc.
You might look into prepared statements too. Assembling a query from strings like that is typical for new programmers, but not the best way to go.
|
Posted by FinalFrontier, 11-15-2011, 03:45 AM |
Thanks guys, you've both been a great help!
Eh, if it works it works. Thats all that matters to me. lol
|
Posted by Grumps, 11-15-2011, 03:55 AM |
Please don't adopt this philosophy...
Not only it does it give PHP a bad name, it hurts your future paycheck.
|
Posted by FinalFrontier, 11-15-2011, 03:58 AM |
I write my own paychecks as I am my own boss, as long as my code works to make me money, then I am happy, so writing the code a 'pro' way or 'newbie' way doesn't matter... as long as the function I require works. Get me?
|
Add to Favourites Print this Article
Also Read