I'm trying to pass an id to a hidden form element and having some syntactical issues.
Here is MySQL query:
$sql="SELECT id,lastname,firstname FROM drivers_0135199";
$result=mysql_query($sql,$con);
echo mysql_error();
Here is my While loop and the hidden form field I am trying to echo out:
while($row=mysql_fetch_array($result)){
echo "<input type='hidden' name='idholder' value=".$row["id"]."/>";
}
mysql_error() returns the following:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
I know the issue is within the echo statement for the hidden function, I just don't know the correct way to manage the quotes in this situation.
Thanks in advance for the help, I couldn't find a great answer in the annals.