Jump to content

possible to strtolower on store_result funtion?


ricmetal

Recommended Posts

hi guys

 

here are my settings:

    * Server: Localhost via UNIX socket
    * Server version: 5.0.91-community
    * MySQL charset: UTF-8 Unicode (utf8)

Web server
    * MySQL client version: 5.0.91
    * PHP extension: mysql

 

my situation:

 

i am retrieving data from the database with the mysqli extension.

...
$stmt = $mysqli->prepare("SELECT city FROM world WHERE city = ? ");
$stmt->bind_param('s',$city);
$stmt->execute();
$stmt->store_result();
if($stmt->num_rows == 0){
  //no rows
}
...

 

i don't want to change any setting to the default configuration set by a script i installed, if i don't have to but i need to test input data (from a html form) against existing data in the dbase for duplicated entries, without taking into account text case. when i test against case-sensitivity, according to testing, an input "lisbon" is different from an existing dbase entry of "Lisbon" but i want it to be the same.

 

i am turning all input data from the html form into lower case before i test it against the data retrieved from the dbase but i need to have the dbase data retrieved turned to lower case as well.

 

anyone have an idea how i would go about doing this?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.