Solved

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

Posted on 2015-01-10
4
82 Views
Last Modified: 2015-01-11
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
Comment
Question by:lawrence_dev
4 Comments
 
LVL 31

Accepted Solution

by:
Marco Gasi earned 500 total points
ID: 40542738
You have to use quotes;
echo $row1["ProductID"]."<BR>";
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 40542783
^^^ What Marco said, use quotes.
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40542956
0
 

Author Closing Comment

by:lawrence_dev
ID: 40543073
Thanks Marco!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question