Solved

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

Posted on 2015-01-10
4
76 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 109

Expert Comment

by:Ray Paseur
ID: 40542956
0
 

Author Closing Comment

by:lawrence_dev
ID: 40543073
Thanks Marco!
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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.

776 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