[TYPO3-dev] Problem with sql query

Brian Bendtsen brb at mentor-it.dk
Tue Jun 20 09:54:22 CEST 2006


Brian Bendtsen wrote:
> Hi
> 
> First of all I have this select statement in an extension I have developed:
> 
> $query = 
> GLOBALS['TYPO3_DB']->SELECTquery('*','tx_boligtilbud_acceptet_offers','caseid='.$this->piVars['sagsnummer'].' 
> AND user_id='.$this->piVars['userid'].'');
> $res = $GLOBALS['TYPO3_DB']->sql(TYPO3_db, $query);
> 
> if(!mysql_num_rows($res)==0) {
>               Do something...
> }
> 
> I suddenly get this error:
> 
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result 
> resource in 
> D:\Domains\initaaq.gl\wwwroot\typo3\typo3conf\ext\boligtilbud\pi1\class.tx_boligtilbud_pi1.php 
> on line 56
> 
> Another thing. I have showphperrors set to 0 in the install tool. They 
> shouldnt be displayed should they?
> 
> Im using typo3 3.8.1
> 
> /Brian Bendtsen

Hi again

I found out that the caseid's was initially like this "124578" but when 
you change it to "12 45 78" the error appears. The caseid field is 
defined as a tinytext. How do I solved this? Can I make it work with the 
spaces?

My php skills are very low 
 
 


/Brian Bendtsen




More information about the TYPO3-dev mailing list