-1

While trying to do something like:

echo "<span>" "<b>" . $row["info1"] . "</b>" . $row["update1"] ."</span>";

It fails with an error log:

unexpected '"', expecting ',' or ';'

  • 2
    Possible duplicate of [PHP parse/syntax errors; and how to solve them?](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – user3783243 Jun 15 '18 at 05:31
  • I'd advocate learning the difference between single and double quotes for strings in PHP. In the above, single quotes would actually make much more sense to me. –  Jun 22 '18 at 21:03

2 Answers2

1

Youre mising "." between "<span>" and "<b>". Change your code like this

 echo "<span><b>" . $row["info1"] . "</b>" . $row["update1"] ."</span>";
Truong Dang
  • 3,119
  • 1
  • 15
  • 21
0

You need to concate it properly http://php.net/manual/en/language.operators.string.php

echo "<span><b> ".$row["info1"]."</b> ".$row["update1"]."</span>";

If you have multiple values to print then try this

$str = '<span>';
foreach($row as $val){
    $str .= '<b> '.$val.'</b>';
}
$str .= '</span>';
echo $str;
DsRaj
  • 2,288
  • 1
  • 16
  • 26