There is a piece of code that displays the categories of goods on each line in the form of hyperlinks

<?php $sql_cat="SELECT * FROM categories ORDER BY id_cat"; $query_cat=mysql_query($sql_cat) or die(mysql_error()); while ($row_cat=mysql_fetch_array($query_cat)) { ?> <p><a href="?id_cat=<?=$row_cat['id_cat']?>"><?=$row_cat['name_cat'];?></a></p>; <?php } ?> 

Explain, please, because I am new to PHP (please treat with understanding), what does the = operator do after? in line

  <p><a href="?id_cat=<?=$row_cat['id_cat']?>"><?=$row_cat['name_cat'];?></a></p>; 
  • depricated This extension is deprecated since PHP 5.5.0 and will be removed in the future. Use MySQLi or PDO_MySQL instead. See also the MySQL instruction: API selection and the corresponding FAQ for more details. Alternatives to this function: mysqli_connect () PDO :: __ construct () - zb '
  • @eicto you want to say that the operator = after? in the line <p> <a href="?id_cat=<?=$row_cat['id_cat'__ ?> "> <? = $ row_cat ['name_cat'];?> </a> </ p>; alternative is the mysql_connect () statement? - ivan89
  • 3
    No, he did not mean it. Just a replica on the topic of working with mysql. And the construction is similar to echo, see ru.wikipedia.org/wiki/PHP The simplest Hello world program in PHP looks like this: <? Php echo 'Hello, world!'; ?> A shorter string output is also possible: <? = 'Hello, world!' ?> - alexlz
  • <p> <a href="?id_cat=<?=$row_cat['id_cat'> ?> "> <? = $ row_cat ['name_cat'];?> </a> </ p>; snatch eyes who came up with this. why not to do: print '<p> <a href="?idcat='. $row_cat['id_cat''s.'">'. $ row_cat ['name_cat']. '</a> </ p>'; - ferrari
  • one
    @ Oleg B, the eyes would be the one who pokes, who writes like that print '<p> <a href="?idcat='. $row_cat['id_cat'yy.'">'. $ row_cat ['name_cat']. '</a> </ p>'; - mountpoint

0