I hate to ask but could someone solve this query for me. I can follow things and buthcer them but constructing it is out of my league. (idea is to pull 2 random quotes and author from database then display the author followed by "--"quote. A line break<br> then repeat the second record> $query = mysql_query("SELECT * FROM dbquotesnew ORDER BY RAND() LIMIT 0,2"); while($row = mysql_fetch_array($query) ) { $author_namme = $row[authorname]; $quote_description = $row[quotedescription]; echo "Quote From" $author_name; "--" echo $quote_description; Code (markup): Can anyone help me with this?
Your code looks like ok. Just complete the loop as below: $query = mysql_query("SELECT * FROM dbquotesnew ORDER BY RAND() LIMIT 0,2"); while($row = mysql_fetch_array($query) ) { $author_namme = $row[authorname]; $quote_description = $row[quotedescription]; echo "Quote From ".$author_name." -- ".$quote_description."<br>"; } Hope it will help you
Thanks .. something not right. I'll keep on trying. For me it's like hunt and peck typing. Sooner or later... but this time it's been along time.