Jump to content

possible to do in one query?


YMYL

Recommended Posts

I'm trying to build a page that fetches information from a database:

 

 

$result2 = $conn->query("select * from votes where pollid='$id'");

for ($count = 0; $row = $result2->fetch_row(); ++$count)

{

echo $row[2].' Votes:'.$row[3]."<BR>";

}

 

However, the information is needed twice. Once for the CSS portion of the page, and the other for the html page. I can do this with one query but is it possible to do this with one query? I'm thinking this would be best for sever load.

Link to comment
https://forums.phpfreaks.com/topic/272800-possible-to-do-in-one-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.