Like so:
Code: Select all
$query="SELECT `users`.`u-email` FROM users WHERE (`users`.`u-email`" && $email && ")";This kind of function is hard to google.
So, how do I do it?
Moderator: General Moderators
Code: Select all
$query="SELECT `users`.`u-email` FROM users WHERE (`users`.`u-email`" && $email && ")";Bigun wrote:I'm trying to construct a MySQL query, and I'm wondering how to combine plain text with a variable to make one single sect of plain text.
Like so:
I'm sure my syntax is *WAY* off, but it's so you get the general idea of what I'm trying to do.Code: Select all
$query="SELECT `users`.`u-email` FROM users WHERE (`users`.`u-email`" && $email && ")";
This kind of function is hard to google.
So, how do I do it?
Code: Select all
$query = "SELECT `users`.`u-email` FROM users WHERE `users`.`u-email`='$email'";You should really have a quick read through the online PHP manual. It is probably one of the best manuals of any language. Do a quick tour through the Language Reference section and the common library sections for: Arrays, Date and Time, Filesystem, Misc., Strings.Bigun wrote:I'm trying to construct a MySQL query, and I'm wondering how to combine plain text with a variable to make one single sect of plain text.
Trust me, an hour into programming, I have firefox open with at least 12 or so tabs.arborint wrote:You should really have a quick read through the online PHP manual. It is probably one of the best manuals of any language. Do a quick tour through the Language Reference section and the common library sections for: Arrays, Date and Time, Filesystem, Misc., Strings.Bigun wrote:I'm trying to construct a MySQL query, and I'm wondering how to combine plain text with a variable to make one single sect of plain text.
I often just keep a browser window open to the online manual when I program. I like that they list related functions with every function, plus user contribited notes at the bottom. I learn something new every time I look something up.