php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10456 Warning: Supplied argument is not a valid MySQL result resource in c:\inetpub\w
Submitted: 2001-04-23 07:39 UTC Modified: 2001-04-23 07:47 UTC
From: joris_van_boven at hotmail dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.4pl1 OS: win 2000
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: joris_van_boven at hotmail dot com
New email:
PHP Version: OS:

 

 [2001-04-23 07:39 UTC] joris_van_boven at hotmail dot com
<html><body>
<h1>Kijk hier een database!</h1>
<a href='Prob01.PHP'>Prob 01 (PHP)</a>
<?
$SQLhost = "localhost";
$SQLgebruiker = "Administrator";
$SQLpassword = "xxxxxxxxx";

// connect database-------------------------------------------------------------------------------------------------

@$objconn = mysql_connect($SQLhost,$SQLgebruiker,$SQLpassword)
 or die("Da is hier mis gelopen! Kan niet inloggen op de database: ".$SQLhost." ".$SQLgebruiker." ".$SQLpassword );

// Basis SQL-string-------------------------------------------------------------------------------------------------

 $Sqlstring = "SELECT id, naam, com FROM prob";

// Ophalen data en in tabel steken----------------------------------------------------------------------------------

 echo "<table border=1><TR><TH>ID</TH><TH>Persoon</TH><TH>Commentaar</TH></TR>";
 $dbRecordSet = mysql_db_query($SQLgebruiker, $Sqlstring);
 while ($dbRecord = mysql_fetch_array($dbRecordSet))
       {
        echo "<TR><TD>".$dbRecord[id]."</TD><TD>".$dbRecord[naam]."</TD><TD>".$dbRecord[com]."</TD></TR>";
       }
 echo "</table>";
// Sluiten database--------------------------------------------------------------------------------------------------

$dbRecord=null;
mysql_close($objconn);
$objconn=null;

?>
</body></html>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-23 07:47 UTC] derick@php.net
RTFM:

mysql_connect ("localhost"," user", "pw");
$query = "SELECT * from blaat";
mysql_select_db ("db1");
$r = mysql_query ($query);
while ($s = mysql_fetch_row($r))
{
/* Do Stuff */
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 19:01:28 2024 UTC