selecting data from database table

selecting data from database table

by M O'S -
Number of replies: 1
I want to select a record from a table and use the return as a string to add to something else, but I seem to be returning it incorrectly. What is the correct way?

I have tried:

$previousValue = get_record_select("myblock_root_record", "timestamp={$yesterday} AND id = 1", "*");

$previousValue = $previousValue->previousrootval;

e.g previousrootval in the table could be the string "languages"

Thanks smile
Average of ratings: -
In reply to M O'S

Re: selecting data from database table

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The most likely thing is that no records match your query.

In particular, if you are selecting on id, there is really no point including anything else in the query conditions, because id is a primary key.

Average of ratings: Useful (1)