0

hi ive got a html table echoing through php and im having problems displaying image in the table heres what i have so far

if($fetch_image['user_image']!='') {
echo '<td>'.$fetch_image['user_image'].'</td>';
 } else {
echo '<td>'.<img  src='images/blank_big.jpg' height='150px;' width='150px;' />.'</td>';
 }

and here is the fetch section

$user_image = mysqli_query($conn,"select * from user_images where user_id = '".$fetch_user['user_id']."' and main_image = '1' ");
$fetch_image    = mysqli_fetch_array($user_image);

and here is the error i am getting
PHP Parse error: syntax error, unexpected '<' in

any help on this would be much appreciated ty jan x

2
Contributors
1
Reply
18
Views
4 Months
Discussion Span
Last Post by cereal
2

It's line 4:

echo '<td>'.<img  src='images/blank_big.jpg' height='150px;' width='150px;' />.'</td>';

The way you are using the concatenation operator (dot operator) is not correct, as <img ... is a string, so it must be quoted. Do:

echo "<td><img src='images/blank_big.jpg' height='150px' width='150px' /></td>";

Bye!

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.