I want make function that check whether specific data is in mydb in mysql. I wrote below function but I get error this line $is_ok_array=mysql_fetch_row($is_ok); Can Someone help me? Sorry my bad English :)
It says: mysql_fetch_row() expects parameter. I searched that error express that my sql doesn't work properly. But my sql query is working. Here is
$query_add ="INSERT INTO notes1 (id,name,size,url,thumbnail_url,delete_url,delete_type) VALUES('$_SESSION[userid]','$file_name','$file_size','$file_url','$file_thumbnail_url','$delete_url','$delete_type')";
-- My Function
protected function is_same($file_name,$file_size,$file_url,$file_thumbnail_url,$delete_url1,$delete_type1) {
$query_same = "Select * From notes1 WHERE id='$_SESSION[userid]' and name='$file_name' and size='$file_size' and url='$file_url' and thumbnail_url='$file_thumbnail_url' and delete_url='$delete_url1' and delete_type='$delete_type1'" or die (mysql_error());
$is_ok = mysqli_query($this->is_db_open,$query_same);
if($is_ok) {
$is_ok_array = mysql_fetch_row($is_ok);
} else {
echo "Wrong query";
}
if($this->is_db_open) {
echo count($is_ok_array);
if((count($is_ok_array))>0) {
return true;
} else {
return false;
}
} else {
echo "Db not open";
}
}