sorry i know this is a basic question, but i have been trying for hours and i cnt seem to think what is wrong with this!
echo '<tr><td><img src="images/$row['picture']" alt="' . $row['username'] . '" /></td>';
is thier a more cleaner way to do this and and error free.
thanks
You are missing a few
'‘s in there.I would do it as follows:
There are a few other ways of doing this, but I wouldn’t recommend either using short tags or inserting variables into strings ever. Doesn’t matter if it is double quoted, terminate the string and concatenate. It is much simpler on the eyes and makes for cleaner code.
You could even avoid string concatenation completely by using
,‘s to separate echo arguments.