i got something really stange going on with mysql.look
<?php
$numid=$_POST['numid'];
$query1="select * FROM datatable LEFT JOIN datatable2 ON datatable.numid=datatable2.numid WHERE ";
$connect=mysql_connect("xxx","xxx","xxx")
or die ("Check your server connection");
$db_found = mysql_select_db("mydb",$connect);
if ($db_found) {
echo "Database FOUND <br>";
if (strlen($numid)>0){
$query1.="numid='$numid' AND ";
}
$query1=substr($query1,0,(strlen($query1)-4));
$result = mysql_query($query1);
$num_r=mysql_num_rows($result);
if ($num_r!=0){
echo "FOUND ".$num_r." RESULTS<br><br>";
while($nt=mysql_fetch_array($result)){
echo "surname: $nt[surname]<br>";
echo "name:$nt[name]<br>";
echo "ID:$nt[numid]<br>";
}
}else {echo "no match found!";}
}
?>
and when i input a number in numid_field i got the message
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\... whats wrong ?