Hi to all I am having this problem can anyone help me to solv this problem pls
here is the code.
first problem
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /hermes/web07/b2501/mydomain.com/htdocs/media.php on line 40
media.php code
<?php
$connection = mysql_connect('localhost','test','test');
if (!$connection)
{
die ('error connecting to database server'.mysql_error());
}
mysql_select_db('hiiraan', $connection);
$result = mysql_query("SELECT * FROM mp3s WHERE id = '{$_GET['id']}'") or die(mysql_error());
if(mysql_num_rows($result))
{
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$mp3s = $row['filepath'];
$title = $row['title'];
$author = $row['author'];
$count = $row['hitcounter'];
//echo $mp3s;
}
}
$count = $count + 1;
$result=mysql_query("Update mp3s set hitcounter='$count' where id='{$_GET['id']}'") or die(mysql_error());
if (mysql_num_rows($result > 0)) // here is line 40
{
echo "records updated";
}
?>
here is the base.php code
<?php
@session_start();
$dbhost = "domain.com"; // this will ususally be 'localhost', but can sometimes differ
$dbname = "test"; // the name of the database that you are going to use for this project
$dbuser = "test"; // the username that you created, or were given, to access your database
$dbpass = "test"; // the password that you created, or were given, to access your database
mysql_connect($dbhost, $dbuser, $dbpass) or die("MySQL Error: " . mysql_error());
mysql_select_db($dbname) or die("MySQL Error: " . mysql_error());
?>