php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11370 Warning: Supplied argument is not a valid MySQL result resource in...line 16
Submitted: 2001-06-08 16:38 UTC Modified: 2001-06-09 01:40 UTC
From: a dot naef at condor-communications dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.5 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
48 - 8 = ?
Subscribe to this entry?

 
 [2001-06-08 16:38 UTC] a dot naef at condor-communications dot com
<?php

$host = "localhost";
$user = "";
$pass = "";
$db = "andre";

$verbindung = mysql_connect($host, $user, $pass);

$sql = "SELECT name FROM test WHERE id='".$id."'";


$result = mysql_db_query($db,$sql);

while($row = mysql_fetch_array($result))  {
	echo htmlentities($row["name"]);
    
	}
mysql_close ($verbindung);

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-09 01:40 UTC] sniper@php.net
works for me just fine. Check your permissions and also
try adding 'echo mysql_error();' lines after the mysql_db_query() and you'll get more info what goes wrong
there. Most likely not enough permissions or the db name is wrong or..Anyway, not a bug in PHP.

--Jani

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 01 20:05:53 2022 UTC