Hello everyone! I'm new in this forum.
I'm having a problem with my coding : when I execute the code below >>
// Retrieve the user's information
$query = "SELECT nama, no_kp, telefon, email, masalah FROM damage_tb WHERE id=$id";
$result = @mysql_query ($query); // Run the query.
if(mysql_num_rows($result) == 1) { // Valid user ID, show the form.
// Get the user's information.
$row = mysql_fetch_array ($result, MYSQL_NUM);
// Create the form.
echo '<h2>Kemaskini Laporan</h2>
<form action="kemaskini.php" method="post">
<p>Nama : <input type="text" name="nama" size="25" maxlength="30" value="' . $row[0]. '" /></p>
<p>No KP : <input type="text" name="no_kp" size="25" maxlength="25" value="' . $row[1]. '" /></p>
<p>Telefon : <input type="text" name="telefon" size="15" maxlength="15" value="' .$row[2]. '" /></p>
<p>Email : <input type="text" name="email" size="25" maxlength="25" value="' .$row[3]. '" /></p>
<p>Masalah : <input type="text" name="masalah" size="30" maxlength="30" value="' .$row[4]. '" /></p>
<p><input type="submit" name="Submit" value="Submit" /></p>
<input type="hidden" name="submitted" value="TRUE" />
<input type="hidden" name="id" value="' . $id . '" />
</form>';
} else { // Not a valid user ID.
echo '<h1 id="mainhead">Page Error</h1>
<p class="error">Laman ini telah diakses secara salah!</p><p><br /><br /></p>';
}
After that this error come out :
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\damage\kemaskini.php on line 112
please advice me... 😕