Re: Re: Pear DB or mySQL problem
| From: | Bob Bell | Date: | Mon, 23 Sep 2002 12:01:29 +0000 |
| Subject: | Re: Re: Pear DB or mySQL problem | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2367@lists.php.net to get a copy of this message | ||
It works for me both directly via the mysql client *AND* with the PHP
mysql code you give below. mysql 3.23.51 and php 4.2.1.
On Mon, Sep 23, 2002 at 04:47:12AM -0700, Kerry Kobashi <kkobashi@thegrid.net> wrote:
> Its not PEAR... as I wrote straight mySQL code ... I get the same result on
> successive calls
> Its almost as if the cursor for mySQL is stuck at either the first or last
> position in my table......
>
> $link = mysql_connect($dbHost, $dbUser, $dbPassword) or die("Could not
> connect");
> print "Connected successfully";
> mysql_select_db($dbName) or die("Could not select database");
>
> $query = "select * from quotations order by rand() limit 1";
> $result = mysql_query($query) or die("Query failed");
> $line = mysql_fetch_row($result);
> echo $line[1];
> mysql_close($link);
>
> Is it a PHP or mySQL problem?
>
>
> "Kerry Kobashi" <kkobashi@thegrid.net> wrote in message
> news:20020923102358.96656.qmail@pb1.pair.com...
> > Windows NT 4.0
> > IIS 4.0
> > PHP 4.2.2
> > mySQL 3.23.52
> > Using PEAR
> >
> > $sql = "select * from $tablename order by rand() limit 1";
> > $db->query($sql);
> >
> > I continue to get the same record
> >
> >
>
>
>
--
Bob Bell <bobbell@zk3.dec.com>
-------------------------------------------------------------------------
"UNIX *is* user friendly.
It's just selective about who its friends are."
-- Author unknown