PHP / MySql - 查询中的连接

I am having problems concatenating a variable to a number (with the variable first, because $info1002 is not a known variable), I appreciate my problem here must be my single double quotations and I've tried a lot of combinations and my googling hasn't helped.

mysql_query("INSERT INTO users (ID, info1) VALUES ('','.$info.''002')")or die(mysql_error());

you need to format it like this:

mysql_query("INSERT INTO users (ID, info1) VALUES ('','".$info."002')") or die(mysql_error());

Also, if you have the ID field set to AutoIncrement, you can ommit it like this:

mysql_query("INSERT INTO users (info1) VALUES ('".$info."002')") or die(mysql_error());

This will insert value of $info followed by 002 into the database.

mysql_query("INSERT INTO users (ID, info1) VALUES ('','".$info."002"')")or die(mysql_error());
mysql_query("INSERT INTO users (info1) VALUES ('{$info}002')")or die(mysql_error());

It may not work only if your ID is set NOT NULL and it not set as autoincrement!

why don't you concatenate if before adding it to the query? I think it is much easier so you don't have that mass with quotation.

$var = $info.'002';
mysql_query("INSERT INTO users (ID, info1) VALUES (null ,'".$var."') or die(mysql_error());