View Single Post
  #4 (permalink)  
Old June 24th, 2006, 09:23 PM
richard.york's Avatar
richard.york richard.york is offline
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

What does this query produce when you run it at the mysql command line or from something like PHPMyAdmin?
Code:
     SELECT `uniqid`, 
            `firstname`,
            `lastname`
       FROM `tablename`
   ORDER BY `lastname` ASC
Are you seeing the id? Are you seeing any errors? Does the HTML look alright when you view the source?

You could also add the following after the query, building in error reporting is always a good idea.
Code:
if (!$query)
{
    echo mysql_error()."<br />\n";
}
In answer to your question, of course you can use an auto incrementing integer field! ;) I remember asking questions like these when I was a beginner; Rule of thumb, if it seems obvious and like it would save time, assume the language/technology supports it!

Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
Reply With Quote