Code: Select all
<?php
mysql_query(“SELECT * FROM users WHERE name=’$name’”);
?>Code: Select all
<?php
mysql_query(“SELECT * FROM users WHERE name=’{$name}’”);
?>Moderator: General Moderators
Code: Select all
<?php
mysql_query(“SELECT * FROM users WHERE name=’$name’”);
?>Code: Select all
<?php
mysql_query(“SELECT * FROM users WHERE name=’{$name}’”);
?>Code: Select all
echo "Post: $_POST['item']";Code: Select all
echo "Post: {$_POST['item']}";Code: Select all
<?php
echo "Post: " . $_POST['item'];
// or
mysql_query("SELECT * FROM users WHERE name=’" . $name . "’");
?>Code: Select all
$var = 'test';
echo "This is a $variing"; // does not work
echo "This is a {$var}ing"; // does not work, outputs "this is a testing"
lol fair enough =]Syntac wrote:andyhoneycutt: No there isn't... Unless you meant the difference between regular syntax and bracket syntax.
I also agree with concatenation being a more preferred method. It's easier to decipher.omniuni wrote:I agree about using concatenation, but that's a cool trick for when you need to put together a bunch of stuff and have PHP correctly find variables of Array type and such.
Thanks All!