Re: Pear DB or mySQL problem
| From: | Kerry Kobashi | Date: | Mon, 23 Sep 2002 11:47:12 +0000 |
| Subject: | Re: Pear DB or mySQL problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-2366@lists.php.net to get a copy of this message | ||
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
>
>