Need assistamce with "Use of undefined constant ProductID - assumed 'ProductID'"

I have only one field "ProductID" in a temporary table.  The field is unique.  I am attempting to extract the ProductID with a select statement and I am receiving a error:

"Use of undefined constant ProductID - assumed 'ProductID'"

The ProductID will be included in a URL string to open individual product pages and scrape data.


$query1 = $conn->query('SELECT ProductID FROM urldownload');

while ($row1 = $query1->fetch(PDO::FETCH_ASSOC))
{

echo $row1[ProductID]."<BR>";


}		

Open in new window

lawrence_devAsked:
Who is Participating?
 
Marco GasiConnect With a Mentor FreelancerCommented:
You have to use quotes;
echo $row1["ProductID"]."<BR>";
0
 
Dave BaldwinFixer of ProblemsCommented:
^^^ What Marco said, use quotes.
0
 
lawrence_devAuthor Commented:
Thanks Marco!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.