Hi,
my prob is the following:
$result = mysql_query("SELECT * FROM week WHERE id = 1")
or die (mysql_error());
This gives me " Resource id #2", but what I want to have is the content of the row with id 1.
What did I make wrong?
Greets
Thanatos
Newbie-Prob
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
$result is a result resource to get the information you are looking for you have to go one step further:
Then you can work with $info because it is an associative array full of all the data from your table:
This will show you all the info in the first row of the result. For more information check out mysql_fetch_assoc() in the manual.
Mac
Code: Select all
$info = mysql_fetch_assoc($result);Code: Select all
foreach ($info as $field => $value) {
echo $field.' = '.$value.'<br />';
}Mac