From: <mic...@us...> - 2005-10-02 19:14:17
|
Update of /cvsroot/tikiwiki/tiki/lib/articles In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2406 Modified Files: Tag: BRANCH-1-9 artlib.php Log Message: Bug tw#349 last_insert_id() is mysql-specific (reported by Thrain) fix contributed by: mo0co0 (edgar) Index: artlib.php =================================================================== RCS file: /cvsroot/tikiwiki/tiki/lib/articles/artlib.php,v retrieving revision 1.40.2.10 retrieving revision 1.40.2.11 diff -u -d -r1.40.2.10 -r1.40.2.11 --- artlib.php 5 May 2005 08:55:15 -0000 1.40.2.10 +++ artlib.php 2 Oct 2005 19:14:09 -0000 1.40.2.11 @@ -149,8 +149,9 @@ $result = $this->query($query,array($title,$authorName,(int) $topicId,$useImage,$imgname,(int) $imgsize,$imgtype, $imgdata,(int) $publishDate,(int) $expireDate, (int) $now,$heading,$body,$hash,$user,0,0,0,(int) $size,$topicName,(int) $image_x, (int) $image_y,$type,(float) $rating,$isfloat,$topline, $subtitle, $linkto, $image_caption, $lang)); - $query = "select `subId` from `tiki_submissions` where `subId`=last_insert_id()"; - $id = $this->getOne($query); + // Fixed query. -edgar + $query = "select max(`subId`) from `tiki_submissions` where `created` = ? and `title`=? and `hash`=?"; + $id = $this->getOne($query, array( (int) $now, $title, $hash ) ); } $emails = $notificationlib->get_mail_events('article_submitted', '*'); |