Solved

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

Posted on 2015-01-10
4
75 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 108

Expert Comment

by:Ray Paseur
ID: 40542956
0
 

Author Closing Comment

by:lawrence_dev
ID: 40543073
Thanks Marco!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to create a scatter graph with straight lines 6 28
Animated .jpg? 13 61
Store image url and display it for user profile 6 23
mysql between clause 2 8
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now