Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8325907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:35:34+00:00 2026-06-09T00:35:34+00:00

I wanna save hashed password in mysql database,so I develop following method in CodeIgniter.

  • 0

I wanna save hashed password in mysql database,so I develop following method in CodeIgniter.

private function hashing($password = '',$mail = '')
{
    $hashcode = md5($password, $mail);
    return sha1($hashcode,md5($hashcode.$mail));
}

for insert:

$data = array('mail'=>$mail,'password'=>$password,'actived'=>1,'time'=>time());
$this->db->insert('users', $data);

other field inserted correctly instead password.

it will generate something like

òLmy­ÉZÔe+ú§3GèÇu‘

it can’t be saved in mysql database.where is the problem?

edit database Collation is utf8_unicode_ci
edit I’m using CodeIgniter,so it doesn’t need mysql_real_…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:35:36+00:00Added an answer on June 9, 2026 at 12:35 am

    You probably meant to do this:

    return sha1($hashcode . md5($hashcode.$mail));
    

    Instead of this:

    return sha1($hashcode,md5($hashcode.$mail));
    

    The second argument to sha1() is a boolean value, controlling whether it returns the hash in raw or string format (false = string, which is what you want to insert).

    http://php.net/manual/en/function.sha1.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanna save mail attachments with size in database. So I open mail in
I have a question about NSUserDefault. Currently, i wanna write a function which save
My question is I wanna apply strategy pattern to save log from Image above
I'm implementing some kind of AdressBook and wanna save all the contacts in some
I wanna log the emails which are being sent from a particular method of
Hey so i'm making a function that gathers up sprites that you wanna keep
i wanna save state of QCheckBok in QSetting, i can cast its value to
I have a method which save settings to file. This method is called if
I just wanna know how i can save the value and the index for
i have a gridview,two buttons(edit,save) ,what i wanna to do is : when click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.