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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 23 10:01:29 2024 UTC