Do you think $q would be the problem with mysql-server-3.23.56-1.9
/* we have here a UNION statement -- that speeds up queries a lot as
opposed to having an OR condition; it takes mysql 4.0.0 at least
*/
---------------------------------------------------------------------------
$q="(SELECT t1.from_uri, t1.sip_from, t1.time, t1.sip_status ".
"FROM missed_calls t1 ".
"WHERE t1.username='".$auth->auth["uname"]."' and
t1.domain='".$config->default_domain."' ) ".
"UNION ".
"(SELECT t1.from_uri, t1.sip_from, t1.time, t1.sip_status ".
"FROM missed_calls t1, aliases t2 ".
"WHERE
'sip:".$auth->auth["uname"]."@".$config->default_domain."'".
"=t2.contact AND t2.username=t1.username AND t2.domain=t1.domain )
".
"ORDER BY time DESC";
------------------------------------------------------------------------------
$mc_res=mySQL_query($q);
if (!$mc_res) {$errors[]="error in SQL query, line: ".__LINE__; break;}
Harry
Le mar 27/04/2004 à 14:38, Klaus Darilion a écrit :
I think the problem is, that there is no stable
serweb.
klaus
gaillac harry wrote:
> Ok thanks !
>
> I'm not a php/mysql developper I can't rewrite serweb, I try my best to
> correct configs files (config.php). it would be a good thing stables
> ser+serweb releases match.
>
> Harry
>
> Le mar 27/04/2004 à 12:44, Klaus Darilion a écrit :
>
>>1. no direct mails -> mail to the list!
>>
>>2. maybe you should make yourself familiar with php, mysql and SQL first!
>>
>>3.
>>
>>gaillac harry wrote:
>>
>>>Here is my missed_calls.php
>>>
>>>Where is the SQL query file ???
>>>
>>> $q="select username, domain from ".$config->table_aliases.
>>> " where
>>>'sip:".$auth->auth["uname"]."@".$config->default_domain."'=contact";
>>>
>>
>>this is an SQL query
>>
>>oh, here is antohter one
>>
>>
>>> $q="delete from ".$config->table_missed_calls.
>>> " where username='".$row."' and
domain='".$dom."' ".
>>> " and time<'".gmdate("Y-m-d H:i:s",
$page_loaded_timestamp)."'";
>>> $res=mySQL_query($q);
>>> if (!$res) {$errors[]="error in SQL query, line: ".__LINE__; }
>>
>>and again a query!
>>
>>> */
>>> $q="(SELECT t1.from_uri, t1.sip_from, t1.time, t1.sip_status ".
>>> "FROM missed_calls t1 ".
>>> "WHERE
t1.username='".$auth->auth["uname"]."' and
>>>t1.domain='".$config->default_domain."' ) ".
>>> "UNION ".
>>> "(SELECT t1.from_uri, t1.sip_from, t1.time, t1.sip_status ".
>>> "FROM missed_calls t1, aliases t2 ".
>>> "WHERE
'sip:".$auth->auth["uname"]."@".$config->default_domain."'".
>>> "=t2.contact AND t2.username=t1.username AND t2.domain=t1.domain )
>>>".
>>> "ORDER BY time DESC";
>>
>>That's probably not very useful for you (as it looks like you have no
>>glue what you are talking about - sorry), but I will give you another
>>hint from your previous mail:
>> > >I've still a problem with missed_calls.php from serweb "error
in SQL
>> > > query, line: 77 No missed calls".
>>
>>--> check line 77 and you will find a query just before it!
>>
>>klaus
>
>
>