-1

on mysql database one table's column name is a & B. When i fetch data from this column data not shown on screen URL is a%20&%20 but when i put %26 instead of & data are shown.

  1. Not shown Data ( http://localhost/dashboard/View-Diploma.php?Course=a%20&%20b )

  2. Shown Data ( http://localhost/dashboard/View-Diploma.php?Course=a%20%26%20b )

Php code -

<a href="View-Diploma.php?Course=<?php echo $cou_row['CourseName']; ?>

try urlencode and change mysql column collation but not work

  • 1
    This is why modern PHP frameworks include a routing layer. – tadman Dec 09 '22 at 14:08
  • https://3v4l.org/nqIpp I think this answer is worth a read: [php prevent & creating codes in a string](https://stackoverflow.com/a/62055171/2943403) – mickmackusa Dec 14 '22 at 03:14

1 Answers1

0
<a href="View-Diploma.php?Course=<?php echo urlencode($cou_row['CourseName']);?>

i insert urlencode now its work

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35