Jump to content

possible to strtolower on store_result funtion?


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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.