Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. "SELECT * FROM table ORDER BY ENum+0 DESC"
  2. you must pass $word $type $flavor $tiers $serves $price to next page (via url or session)
  3. where are you setup this variables $wordx $typex $flavorx $tiersx $servesx $pricex
  4. change $maxdata = $row['MAX($maxField)']; to $maxdata = $row["MAX($maxField)"];
  5. you have TWO results not 6 in while loop each time you echo 3 html table (<tr> tag) rows are you want to while loop repeat 1.333 times? (for 4 html rows)
  6. $results = split(",", trim($_GET{'results'},', '));
  7. and what do you want to repeat
  8. insert some spaces after #__magazine_users or before WHERE
  9. oh i forget to add last part of the text please change return $out; to return $out.$text;
  10. try <?php $test = '<ul> [*]list item 1 [*]list item 2 [*]list item 3 </ul>'; echo $out = preg_replace_callback('/\[\*\]([^[]*)\n(?=\[|<)/', create_function('$a', 'return "<li>".nl2br($a[1])."</li>\n";'), $test); ?>
  11. try to print_r($t); and see what's hapend ($title = $t[2]
  12. your query returns two rows, and each of this row output 3 table rows 2*3=6 rows total
  13. try $eventssql = "SELECT *, shortlists_history.date As sdata FROM events, shortlists_history WHERE events.shortlist_id={$short['shortlist_id']} && shortlists_history.shortlist_id={$short['shortlist_id']} ORDER BY shortlists_history.date DESC"; $eventsresult = mysql_query($eventssql) or die(mysql_error()); ... $sdate = $events['sdate']; ...
  14. try <?php $test = 'xabahb'; $code_entities_match = array('a','b'); $code_entities_replace = array('cb','de'); function my_replace($match, $replace, $text){ $out = ''; $test = false; foreach ($match as $k => $m){ $x[$replace[$k]]= $m; if (strpos($text, $m) !== false) { $pos[$replace[$k]] = strpos($text, $m); $test = true; } } while ($test){ $p = min($pos); $m = array_search($p, $pos); $out .= substr($text,0,$p). $m; $text = substr($text, $p+strlen($x[$m])); $test = false; foreach ($match as $k => $m){ if (strpos($text, $m) !== false) { $pos[$replace[$k]] = strpos($text, $m); $test = true; } else unset($pos[$replace[$k]]); } } return $out; } echo my_replace($code_entities_match, $code_entities_replace, $test); ?>
  15. oops try protected function displayNewComments() { $new_comment = $this->model->getReadComment($_SESSION['User_ID']); $html ='<div id="user">'."\n"; $html .="<div class='entry_header_space'>".$new_comment."</div>"; echo $html; $rso=$this->model->getUnreadComments($_SESSION['User_ID']); $last_title = ''; while($comments=$rso->fetch_assoc()) { if ($last_title != $comments['Entry_Title']){ $last_title = $comments['Entry_Title']; $html="<h2>".$comments['Entry_Title']."</h2>"; } else $html = ''; $html .=$comments['Comment_Date'] ." new comment by ".$comments['User_ID'] ; echo $html; } }
  16. try protected function displayNewComments() { $new_comment = $this->model->getReadComment($_SESSION['User_ID']); $html ='<div id="user">'."\n"; $html .="<div class='entry_header_space'>".$new_comment."</div>"; echo $html; $rso=$this->model->getUnreadComments($_SESSION['User_ID']); $last_title = ''; while($comments=$rso->fetch_assoc()) { if ($last_title != $comments['Entry_Title']){ $last_title = $comments['Entry_Title']; $html="<h2>".$comments['Entry_Title']."</h2>"; } $html .=$comments['Comment_Date'] ." new comment by ".$comments['User_ID'] ; echo $html; } }
  17. try[if (!mysql_query($sql)) { echo $sql,'<br />'; echo mysql_error(),'<br />'; die('You have already submitted a request to this association from this horse');} and post the error
  18. if ($oldStatusCode == 1) { $selectQuery .= " and ISNULL(updatedby)"; }
  19. $sql="SELECT * FROM horsedata LEFT JOIN registration ON registration.horseid = horsedata.id WHERE Owner='$id' AND ISNULL(registration.assoname) GROUP BY horsedata.id";
  20. this part of code if ($oldStatusCode == 1) { $selectQuery .= " and updatedby = ''"; }
  21. $sql="SELECT * FROM horsedata LEFT JOIN registration ON registration.horseid = horsedata.id WHERE Owner='$id' AND (registration.assoname != '$assoname' OR ISNULL(registration.assoname)) GROUP BY horsedata.id";
  22. and you look name='' (empty string) but names is null http://dev.mysql.com/doc/refman/5.0/en/problems-with-null.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.