• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 105
  • Last Modified:

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

0
lawrence_dev
Asked:
lawrence_dev
1 Solution
 
Marco GasiFreelancerCommented:
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.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now