Re: what is wrong with my php code?
| From: | msa | Date: | Mon, 03 May 2004 17:08:19 +0000 |
| Subject: | Re: what is wrong with my php code? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185209@lists.php.net to get a copy of this message | ||
this has now been added to the top:
<?php require_once('Connections/jpike.php'); ?>
<?php
mysql_select_db($database_jpike, $jpike);
$query_rsarchiveTest = "SELECT * FROM ArchiveNews";
$rsarchiveTest = mysql_query($query_rsarchiveTest, $jpike) or
die(mysql_error());
$row_rsarchiveTest = mysql_fetch_assoc($rsarchiveTest);
$totalRows_rsarchiveTest = mysql_num_rows($rsarchiveTest);
?>
and to the bottom:
<?php
mysql_free_result($rsarchiveTest);
?>
I am using Dreamweaver and it writes the code for the connection to the
database...
"Msa" <melissa@maddesignusa.com> wrote in message
news:20040503170413.96467.qmail@pb1.pair.com...
> or.... I get the error message: No Database Selected.
>
> OK, obviously a problem.....
>
> "Msa" <melissa@maddesignusa.com> wrote in message
> news:20040503165645.74232.qmail@pb1.pair.com...
> > page tries to load forever and then I get a parse error on line 79 which
> is
> > the line I added from below....
> >
> > "John Nichel" <john@kegworks.com> wrote in message
> > news:409677BC.7060501@kegworks.com...
> > > msa wrote:
> > > > mysql_fetch_array(): supplied argument is not a valid MySQL result
> > resource
> > > > in..file name...on line 82
> > >
> > > Right after this line...
> > >
> > > $result = mysql_query($query);
> > >
> > > Put this....
> > >
> > > echo ( "<br /><br />Error : " . mysql_error() . "<br
> > > /><br />" );
> > >
> > > And let us know what the output is.
> > >
> > >
> > > --
> > > John C. Nichel
> > > KegWorks.com
> > > 716.856.9675
> > > john@kegworks.com