PHP problems with COLLATE ?
Posted by: Bogdan Enache
Date: July 27, 2006 01:21AM

OK, so I have this PHP code:

if ($dbc->multi_query($s)){

$ret = array();
if($res = $dbc->store_result()){
$no = $res->num_rows;
for($i = 0; $i < $no; $i++){
$ret[$i] = $res->fetch_assoc();
}
if($res){
$res->close();
}
return $ret;
}
}
else{

echo 'Query failed: '; var_dump($s);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
exit;
return FALSE;
}

IF I set $s="SELECT * FROM view_cl_all WHERE (cl_name LIKE '%al%' )"it's working, i get a number of results.

But if $s="SELECT * FROM view_cl_all WHERE (cl_name LIKE '%al%' COLLATE utf8_general_ci)"

Then query silently fails. Goes directly to the else section, diplays 'Query failed: ', but no mysqli error !!!!

BUT, in Query Browser both work... I don't get it !

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.