Re: [PHP4BETA] Probs with mysql_db_query and mysql_result
| From: | David Robley | Date: | Fri, 01 Oct 1999 00:18:36 +0000 |
| Subject: | Re: [PHP4BETA] Probs with mysql_db_query and mysql_result | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-5049@lists.php.net to get a copy of this message | ||
On 30 Sep, Dirk Schmidt wrote:
>
> Hello list,
>
> I have a Problem with mysql_db_query and mysql_result. The mysql_db_query
> in the following Code
> does only work, if i delete the third parameter ($ConnID). Otherwise i get
> a 'Document contains no
> data' - Error in the browser.
>
> $ConnID = mysql_pconnect("localhost", "root", "password");
> $Rs = mysql_db_query("database", "select * from DateiTypen", $ConnID);
>
> without a connection-ID it seems to work:
>
> $ConnID = mysql_pconnect("localhost", "root", "password");
> echo $ConnID . " ";
> $Rs = mysql_db_query("database", "select * from DateiTypen");
> echo $Rs;
>
> this gives 'Resource id #1 Resource id #2' as Output.
> But I can't get a value out of the ResultSet then. The following Code gives
> a 'Document contains
> no Data' - Error again:
>
> $Value = mysql_result($Rs, 0, "Beschreibung");
> echo $Values;
>
>
> Environment: Solaris 7, Apache 1.3.6, php40b3-dev. The same Code works
> without problems on
> Linux/Apache 1.3.6/php40b2 against the same mysql-Server.
>
> Please help,
> thanks a lot,
>
> Dirk
You might try adding a call to mysql_error() imediately after the call
to mysql_result() to see if there is a mysql error being returned.
Cheers
--
David Robley
WEBMASTER | Phone +61 8 8374 0970
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
Visit the PHP mirror at http://au.php.net:81/
<<<<<<<<<<<<< WARNING * END OF TEXT * STOP READING HERE
>>>>>>>>>>>>>>