Welcome Guest, Not a member yet? Register   Sign In
Charset, CI or MySQL problem ??? ( or dumb coder problem ??? )
#1

[eluser]charlie spider[/eluser]
So in the administrative backend for a boot company site i'm building, i have a text area in a form where they can write a description for each boot, and then click save to put everything into the MySQL database.

it's a standard text area and the code i'm using to save it is like this:

Code:
if ( $this->Boot_model->update_boot_text(
            $this->input->post('ID'),
            $this->input->post('number'),
            $this->input->post('name'),
            $this->input->post('type'),
            $this->input->post('desc1'),
            $this->input->post('desc2')
        ))

then i use standard Active Record method to insert it into the db.

Code:
$this->db->update('boot_table', $data_array)

To redisplay the info in the admin area, or on the public side of the site, i pass the entire object to my controller ( instead of converting to an array ):

Code:
$query = $this->db->get();
if ($query->num_rows() > 0)
{
    foreach ($query->result() as $row)
    {
        $content = $row;
    }
    return $content;
}

and then refer to the data object directly:

Code:
<p class="desc">' . $boot->desc1 . '</p>';
<p class="desc">' . $boot->desc2 . '</p>';

this imho is way easier than dealing with the extra layers of arrays that happens when you convert the query row results to arrays


ANYWAYS...

the problem is that i am trying to populate the database with info from a PDF version of this company's catalogue, and if i copy a bunch of text from the PDF, such as:

Code:
A 10” lace-to-toe Stitch down boot with
Vibram® Sierra oil resistant lug sole with
urethane cushioned heel. The best easy entry
style to fit high instep and special widths.
CSA grade 1 steel toe and plate.

paste it into the text area and save it...

it comes back looking like this:

Code:
A 10

or it will break on other characters such as the registered symbol:

Code:
Vibram®


It's not even that these characters are getting stripped from the paragraph, the entire paragraph just ends whenever any kind of special character comes along.

Is this because of CI ?

I have never had the time to go through every line of code in the CI libraries ( nor do i want to at this moment ), so does anybody know specifically which library / function i should be looking for if i need to do some customization ?

Or is this a charset problem ? Or is it a MySQL problem ?

i can add the same paragraph directly into the db with phpMyAdmin and it doesn't break the paragraphs like above, but it also doesn't convert the characters properly, and adds all kinds of strangeness. So whatever other problems i have ( not including my only personal issues Wink ) i also seem to have a charset problem.

Any and all help is greatly appreciated

Thank you


Messages In This Thread
Charset, CI or MySQL problem ??? ( or dumb coder problem ??? ) - by El Forum - 06-29-2008, 11:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB