Problem displaying results
Posted: Sun Dec 04, 2005 10:24 pm
Jcart | Please use
Here's the code of the php file:
On the var_dump, I get:
resource(4) of type (Unknown)
What am I missing here. Help is much appreciated, because I really should push on this project. Just in case the environment:
All local:
Windows XP Prof
Apache/1.3.33 (Win32)
MySQL 5.0.15-nt
PHP 5.0.5
Thank you in advance!
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Hi all,
I used excactely this script on an other website, where it works perfectly well. Now I'm building a new site and it get the following error:Code: Select all
Warning: mysql_fetch_array(): 4 is not a valid MySQL result resource in c:\wamp\www\growthring\cms\cmsUser.php on line 23Code: Select all
<?php
include("condata.php");
$dbh = mysql_connect ("$MySQLHost", "$MySQLUser", "$MySQLPW") or die ('I cannot connect to the database because: ' . mysql_error());
$sql = "SELECT userID, userProf, userClearance, userName FROM users";
$result = mysql_db_query("historing", $sql) or die("Invalid query: " . mysql_error());
// Resultat freigeben
mysql_free_result($result);
?>
<html>
<head>
<title>Growth Ring CMS - Enter New User</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../styles/styles_cms.css" rel="stylesheet" type="text/css">
</head>
<body>
USER ADMINISTRATION<br><br>
<a href="cmsUserNew.php">Click here</a> to add a new User!<br><br>
The following members are registered!<br><br>
<?php
var_dump($result);
while ($reguser = mysql_fetch_array($result)) {
echo $reguser['userID'];
}
// Verbindung schliessen
mysql_close($dbh);
?>
</body>
</html>resource(4) of type (Unknown)
What am I missing here. Help is much appreciated, because I really should push on this project. Just in case the environment:
All local:
Windows XP Prof
Apache/1.3.33 (Win32)
MySQL 5.0.15-nt
PHP 5.0.5
Thank you in advance!
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]