Yii Framework Forum: Postgres field with capital letter - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Postgres field with capital letter Postgres field with capital letter Rate Topic: -----

#1 User is offline   André Couto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 22-January 11
  • Location:Feira de Santana,Ba

Posted 05 February 2012 - 02:15 PM

:( Someone help me please?

in postgres
Is there any solution for fields with capital letter in the table?

Original Post: My link original Post


$criteria=new CDbCriteria;

                $criteria->compare('Id',$this->Id);
                $criteria->compare('IdPessoa',$this->IdPessoa);
                $criteria->compare('Usuario',$this->Usuario,true);
                $criteria->compare('Senha',$this->Senha,true);
                $criteria->compare('IdGrupo',$this->IdGrupo);
                $criteria->compare('Status',$this->Status,true);
                $criteria->compare('UltimoAcesso',$this->UltimoAcesso);
                $criteria->compare('DataValidade',$this->DataValidade);
                $criteria->compare('DataCadastro',$this->DataCadastro);

                return new CActiveDataProvider($this, array(
                        'criteria'=>$criteria,
                ));


Error:
Error 500: <!DOCTYPE html PUBLIC
        "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>CDbException</title>

<style type="text/css">
/*<![CDATA[*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;}
ol,ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:none;}
:focus{outline:0;}
ins{text-decoration:none;}
del{text-decoration:line-through;}
table{border-collapse:collapse;border-spacing:0;}

body {
        font: normal 9pt "Verdana";
        color: #000;
        background: #fff;
}

h1 {
        font: normal 18pt "Verdana";
        color: #f00;
        margin-bottom: .5em;
}

h2 {
        font: normal 14pt "Verdana";
        color: #800000;
        margin-bottom: .5em;
}

h3 {
        font: bold 11pt "Verdana";
}

pre {
        font: normal 11pt Menlo, Consolas, "Lucida Console", Monospace;
}

pre span.error {
        display: block;
        background: #fce3e3;
}

pre span.ln {
        color: #999;
        padding-right: 0.5em;
        border-right: 1px solid #ccc;
}

pre span.error-ln {
..."trace-file">
                                                                                        <div class="plus">+</div>
                                                <div class="minus">–</div>
                                                                                &nbsp;C:\WAPP\apache2\htdocs\martyii\index.php(13): <strong>CApplication</strong>-><strong>run</strong>()                               </div>

                                <div class="code"><pre><span class="ln">08</span> defined('YII_DEBUG') or define('YII_DEBUG',true);
<span class="ln">09</span> // specify how many levels of call stack should be shown in each log message
<span class="ln">10</span> defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
<span class="ln">11</span> 
<span class="ln">12</span> require_once($yii);
<span class="error"><span class="ln error-ln">13</span> Yii::createWebApplication($config)-&gt;run();</span></pre></div>                        </td>
                </tr>
                                </table>
        </div>

        <div class="version">
                2012-02-03 11:19:02 Apache <a href="http://www.yiiframework.com/">Yii Framework</a>/1.1.9       </div>
</div>

<script type="text/javascript">
/*<![CDATA[*/
var traceReg = new RegExp("(^|\\s)trace-file(\\s|$)");
var collapsedReg = new RegExp("(^|\\s)collapsed(\\s|$)");

var e = document.getElementsByTagName("div");
for(var j=0,len=e.length;j<len;j++){
        if(traceReg.test(e[j].className)){
                e[j].onclick = function(){
                        var trace = this.parentNode.parentNode;
                        if(collapsedReg.test(trace.className))
                                trace.className = trace.className.replace("collapsed", "expanded");
                        else
                                trace.className = trace.className.replace("expanded", "collapsed");
                }
        }
}
/*]]>*/
</script>

</body>
</html> 

0

#2 User is offline   André Couto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 22-January 11
  • Location:Feira de Santana,Ba

Posted 11 February 2012 - 01:09 PM

:( Someone help me please?

in postgres
Is there any solution for fields with capital letter in the table?

Original Post: My link original Post

Example:

Table name: table_user
Fields: IdUser, User, Action...

Any solution to stop the 500 error???
0

#3 User is offline   redguy 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 244
  • Joined: 02-July 10
  • Location:Central Poland

Posted 11 February 2012 - 01:11 PM

you have to use quotes:
"IdUser", "User", "Action"

so criteria would look like this:
$criteria->compare('"IdPessoa"',$this->IdPessoa);

(there are single AND double quotes used in example above)
red
1

#4 User is offline   André Couto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 22-January 11
  • Location:Feira de Santana,Ba

Posted 11 February 2012 - 01:17 PM

View Postredguy, on 11 February 2012 - 01:11 PM, said:

you have to use quotes:
"IdUser", "User", "Action"

so criteria would look like this:
$criteria->compare('"IdPessoa"',$this->IdPessoa);

(there are single AND double quotes used in example above)



:D Muito obrigado!!!
Thank you!

0

#5 User is offline   André Couto 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 81
  • Joined: 22-January 11
  • Location:Feira de Santana,Ba

Posted 11 February 2012 - 01:22 PM

Complementar informação:

View Postredguy, on 11 February 2012 - 01:11 PM, said:

you have to use quotes:
"IdUser", "User", "Action"

so criteria would look like this:
$criteria->compare('"IdPessoa"',$this->IdPessoa);

(there are single AND double quotes used in example above)

0

#6 User is offline   mdomba 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,664
  • Joined: 12-October 09
  • Location:Croatia

Posted 11 February 2012 - 04:08 PM

NOTE: merged topics about same problem
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users