I think, on line 5: $anz is a array.
So that,you try again: echo $anz[0];
0 = the first name column.
1 = the second name column.
Best Regards.
Do Minh Duc
Dragir wrote:
Hello.
I have installed Apache, php4 and MySQL on my Win ME PC. It was all working fine, I could create and fill tables with PHPMyAdmin.
But than I tried to access the Database with the following script:
<?
$link = mysql_connect("localhost", "root");
mysql_select_db("database",$link);
$query = mysql_query("SELECT * FROM table",$link);
$anz = mysql_affected_rows($query);
echo $anz;
?>
The Output is as follows:
Warning: Supplied resource is not a valid MySQL-Link resource in c:\windows\desktop\local_www\test2.php on line 5
I checked the syntax, tried with pconnect, with other usernames and more. But nothing worked.
Can anyone help me here?
CU Dragir