Query String



OK I have done this several times before, but now cannot see the wood
for the trees.

I want to search the database table "news" for all items with the
field "active" set to "Yes", and then output the field "title" for
each returned result. The database connection is OK.

I get an error message Fatal error: Call to undefined function
mysql_fetch_objects()

What am I doing wrong... Its been a long day, sorry..

<?php
$query = ("SELECT title FROM news WHERE active='Yes' ");
$result = mysql_query($query) or die ('Error in query: $query . ' .
mysql_error());
if (mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_objects($result))
{
$title = $row['title']; echo $title;
}
}
?>

Thanks in advance.....

Alec
.



Relevant Pages

  • Re: Newbie: Help Please!
    ... Hand coded html for years ........ ... yourself into a "can't see the wood for the trees" situation. ... I have a row in the mysql database table called image_ref where the ...
    (alt.php)
  • Re: Dabbling in plain-text databases
    ... plain-text databases (and if they're worth using in lieu of sql). ... will be sort of a video game fansite, that will have a news page (news ... parsing a file like that any faster or slower than using MySQL? ... An sql based database is better for situations requiring  better ...
    (comp.lang.php)
  • Re: UUIDs (Was: Software implementing Gentech Genealogical Data Model)
    ... suggest is that an identifier based on some concatenation of data elements ... Now, the only time such a uuid would have any significance, or so it seems ... IDs are to be key for our database. ... trees can all be given UUIDs by combining the ID number of the tree ...
    (soc.genealogy.computing)
  • Re: Dabbling in plain-text databases
    ... plain-text databases (and if they're worth using in lieu of sql). ... will be sort of a video game fansite, that will have a news page (news ... parsing a file like that any faster or slower than using MySQL? ... An sql based database is better for situations requiring better ...
    (comp.lang.php)
  • Re: passing objects into methods that do database processing?
    ... I am working on a news section of a website. ... edit and delete news articles from the database. ... the helper class and probably the NewsItem object or data type depending how ... Date - DateTime (The date/time the news article was posted). ...
    (microsoft.public.dotnet.languages.csharp)