I have a Problem when including using localhost. lets say that i have mysql query like this, $strQuery="SELECT employeeName,employeeId FROM employee_tbl where employeeId='$employeeId' "
. Then i Use mysql_num_rows() to make sure that employee with that employeeId exist in my database, but when i use the query it says that mysql_num_rows expecting 1 to be result
(correct me if im wrong).
It gave me 2 hours headache to fix the problem. First I check the Query, no problem found. Then i Check The Input from HTML input with my var at PHP, nothing wrong. When i cant take the headache anymore i change the Include from localhost to relative path of my app, and IT's WORKED.
i Have no Idea whats wrong. So If you could tell me spesificly it would be nice. Thanks.
As Requested This is My Exact Code :
`<?php
include "localhost/sampleWeb/conf/connection.php";
some code right here
$strQuery="SELECT employeeName,employeeId FROM employee_tbl where employeeId='$employeeId'";
$execQuery=mysql_query($strQuery);
$getData=mysql_num_rows($execQuery)
if ($getData == 0) {
some script done here
} else {
some script done here
}
another code here
?>`
*NOTE : the Error have been fixed, but i have no idea why localhost cause the error. Thats why im asking u too shae your knowledge :D