Jump to content

Archived

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

bob_the _builder

sql query between echo

Recommended Posts

Hi,

Is there a way to place an sql query between:

echo 'some html here';

without breaking the echo and starting it again?

Its to populate a list/menu fom the db which is within echo.


Thanks

Share this post


Link to post
Share on other sites
do the query first and display the desired result within, like

[code]
<?php

while($r=mysql_fetch_array($query))
{
  $option .="<option value".$r['xx'].">".$r['xxx']."</option>";
}

echo <<<__HTML

<select name="x">
$option
</select>

__HTML;

?>
[/code]

Share this post


Link to post
Share on other sites

×

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.