-3

Can anybody help me out here? How can I write this correctly?

echo "<td><a type='button' href='patent_edit.php?id="$patent_id"' >Edit</a>;</td>"; 

I am getting error that

Parse error: syntax error, unexpected '$patent_id' (T_VARIABLE), expecting ',' or ';' in C:\xampp\htdocs\moduletwo\patent_view.php

lifehack
  • 29
  • 6

4 Answers4

0

Error is at $patent_id you're not concatenating it right try this

 echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a></td>";
Saad Suri
  • 1,352
  • 1
  • 14
  • 26
0
echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a>;</td>";
Dhaval Chheda
  • 4,637
  • 5
  • 24
  • 44
0

Replace your

echo "<td><a type='button' href='patent_edit.php?id="$patent_id"' >Edit</a>;</td>"; 

With

echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a></td>"; 
Tomas
  • 514
  • 4
  • 13
  • 37
0

This is a very common syntax error. You are facing concatenation problem.

You can solve this by this:

echo "<td><a type='button' href='patent_edit.php?id=$patent_id' >Edit</a>;</td>";

or this

echo "<td><a type='button' href='patent_edit.php?id=".$patent_id."' >Edit</a>;</td>";
Mahbubul Islam
  • 998
  • 1
  • 10
  • 24