Jump to content

how come this don't work?


desjardins2010

Recommended Posts

Hi, me again;

 

i'm curious why this don't work and what would in it's replace;

 

echo "<b>".$row['name'].['id']."</b><BR>";

 

basically what I'm trying to do is that it read like this

 

Your in game name is ['name'] with id set to ['id']

 

I figure if I can get the name and id beside each other I can figure out how to the add the your in game name is and with id set to part myself :)

 

sorry guys don't mean to be a bother

Link to comment
https://forums.phpfreaks.com/topic/220942-how-come-this-dont-work/
Share on other sites

You can either use the curly braces as I did above, or you can use string concatenation like below. I personally find the curlies easier to read, especially when there's a lot of other quoting in the string, as there would be in a database query and the like.

 

echo "<b>" . $row['name'] . $row['id'] . "</b><BR>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.