![]() |
|
|
|||||||
![]() |
|
|
Thread Tools | Rate Thread |
|
|
PM User | #1 |
|
New to the CF scene Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
Resource ID#4?
Hi Guys,
im new to PHP and MySQL. im trying to get a very very very simple query from a MySQL db using the following code, but it keeps giving me "Resource ID#4" Any ideas? ########################################### <?php //Call the MySQL location, user and password from the mysql_db.php file// require("mysql_db.php") ?> <?php $query="SELECT * FROM products"; $results=mysql_query($query) or die(mysql_error()); echo $results; ?> ########################################### cheers Yo_da84 |
|
|
|
|
|
PM User | #2 |
|
Master Coder ![]() ![]() Join Date: Jul 2002
Posts: 6,589
Thanks: 0
Thanked 0 Times in 0 Posts
![]() |
welcome here!
mysql_query() returns a resource-id, which is a handle to get the actual data from the recordset. But you need to us a function like mysql_fetch_assoc() to get the actual date. The traditional code to do this is: PHP Code:
__________________
Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Rate This Thread | |
|
|