On 6 May, 16:19, Mtek <m...@[EMAIL PROTECTED]
> wrote:
> On May 6, 9:52 am, sheldonlg <sheldonlg> wrote:
>
>
>
> > Mtek wrote:
> > > On May 6, 6:56 am, Tom Cole <tco...@[EMAIL PROTECTED]
> wrote:
> > >> On May 6, 12:37 am, Mtek <m...@[EMAIL PROTECTED]
> wrote:
>
> > >>> On May 5, 5:46 pm, SAM
<stephanemoriaux.NoAd...@[EMAIL PROTECTED]
>
> > >> You're not going to be able to include PHP code inside your HTML
and
> > >> have it magically generate results for you on the client side.
>
> > >> HTH.
>
> > > No, cannot include PHP on the client side, but how about calling a
PHP
> > > routine on the server and returning the results? I've seen simple
> > > examples of this, though mine is a bit more complex......
>
> > > John.
>
> > Yes, they call that AJAX.
>
> Hmmm....I was trying something like this. Can you tell me where I'm
> wrong. I thought it would work. I'll try reading up on AJAX, but I
> was curious about this method. It give me an error about the reg_date
> not being defined in the PHP script:
>
> .
> .
> .
> <script>
> function getrows(reg_date) {
> do***ent.getElementById("innerb").innerHTML = XMLHttpRequest("URL/
> viewrows.php");
> }
> </script>
> .
> .
> .
> <?
> echo "<SELECT NAME='reg_date' onChange=
> \"Javascript:getrows(this.value);\" size=1>\n";
> $result = mysql_query("SELECT
> DISTINCT(DATE_FORMAT(reg_date, '%m/%d/%Y')) FROM reg_data ORDER BY
> reg_date;");
> while ($rows = mysql_fetch_array($result)) {
> echo "<OPTION>";
> echo $rows['reg_date'];
> echo "</OPTION>";
> }
> echo "</SELECT>\n";
> ?>
> .
> .
> .
>
> <?
> echo " <tbody>";
> echo " <tr>";
> echo " <td colspan='6'>";
> echo " <div class='innerb'>";
> echo " <table class='tabletwo'>";
> include('viewrows.php');
> echo " </table>";
> echo "</div>";
> echo "</td></tr>";
> echo "</tbody>";
> echo "</table>";
> ?>
> .
> .
> .
>
> Thanks for everyone's help so far......
>
> John
This reall belongs in a php group, but try this
$result = mysql_query("SELECT
DISTINCT(DATE_FORMAT(reg_date, '%m/%d/%Y')) reg_date FROM reg_data
ORDER BY
reg_date;");


|