Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. oops add GROUP BY horsedata.id to the end of query
  2. $sql="SELECT * FROM horsedata LEFT JOIN Registration ON Registration.horseid = horsedata.horseid WHERE Owner='$id' AND Registration.assoname != 'specific association'";
  3. in your sql you look for rows with status=1 (oldStaus from your form) but status in your table is 0
  4. in line 83 you setup variable $r and after use variable $result
  5. change this part of code } } // if no records present // display message ?> </table> <?php else { to } // if no records present // display message ?> </table> <?php } else { move } before else
  6. are you sure that status = 1 for all records? can you post some db values for testing, just few rows
  7. remove line 88
  8. try echo"<option value={$row['specialty_id']}",$row['specialty_id']==$formVars["specialty_id"]? " selected='selected'" : '',">{$row['specialty']}</option>";
  9. can you post your form code
  10. remove comma just befor from in your sql $selectQuery = "SELECT rowId, columnId, from seats where ("; must be $selectQuery = "SELECT rowId, columnId from seats where (";
  11. try $number = array(10, 20); $number2 = array(30, 40); $number3 = array(50, 60); $numbers = array( $number, $number2, $number3); shuffle($numbers); $number4 = 25; //if ($number4 >= $??????1) { // '$??????1' = 10 or 30 or 50 // $result = $number4 - $??????1; // $result2 = $number4 - $??????2; // '$??????2' = 20 or 40 or 60 //} else { while ($number4 < $numbers[0][0]) { shuffle($numbers); } $result = $number4 - $numbers[0][0]; $result2 = $number4 - $numbers[0][1]; //} when you setup array $numbers remove quotes
  12. try $original = preg_replace ("/<span id=\"$id\">.*?<\/span>/",'hello',$string);
  13. you didn't close for loop opened in line 290
  14. try <?php $test = 'A*B*C COMPANY'; echo $proper = preg_replace_callback('/\*([a-z])/', create_function('$matches','return strtoupper($matches[1]);') , ucwords(strtolower($test))); ?>
  15. try $_SESSION['favoriteArray']= array_values($_SESSION['favoriteArray']); $i=0; while ($i < $favorites_Size){ echo $_SESSION['favoriteArray'][$i]." <a href=$url&function=remove_favorite&cocktail=$favoritesArray[$i]&ai=$i>[x]</a><br />"; $i++; }
  16. change $insertsql = "INSERT INTO candidate_coms ('com_type','com_by','com_user','com_content','com_inout','candidate_id') VALUES ($coms_type, $coms_by, $coms_user, $coms_content, $coms_inout, $candidate_id)"; mysql_query($insertsql) or die(mysql_error()); to $insertsql = "INSERT INTO candidate_coms (`com_type`,`com_by`,`com_user`,`com_content`,`com_inout`,`candidate_id`) VALUES ('$coms_type', '$coms_by', '$coms_user', '$coms_content', '$coms_inout', '$candidate_id')"; mysql_query($insertsql) or die(mysql_error());
  17. try <?php function xyz($a, $b){ $newFileArray = array(); for ($i = 0; $i < count($a); $i++){ $newFileArray[] = $a[$i]; for ($j = 0; $j < count($b); $j++){ if ($a[$i]['ID']==$b[$j]['RepliedToStartID']) $newFileArray[] = $b[$j]; } } return $newFileArray; } $newFileArray = array_shift($levelFileArray); while (!empty($levelFileArray)){ $next = array_shift($levelFileArray); $newFileArray = xyz($newFileArray, $next); } ?>
  18. try <td colspan="2"><input name="deduction" type="text" id="deduction" <?php if ($deduction !='') echo "value=\"$deduction\""; ?>><div class="highlight" id="inf_deduction"> look http://hr.php.net/empty
  19. try <?php $test='Apple 1 Folder Macbook 1/1 Folder Pro 1/1/1 File iPod 1/2 Folder Nano 1/2/1 File iPhone 1/3 File Microsoft 2 Folder Applications 2/1 Folder Office 2/1/1 File Hardware 2/2 Folder XBox 2/2/1 File'; foreach (explode("\n", $test) as $r){ $r = explode("\t", $r); $data[] =array('Title' => $r[0], 'PI_ID' => $r[1], 'TYPE' => $r[2]); } // $data simulate data from database echo "<ul>\n"; $open_ul = 1; foreach ($data as $rsFolders_row){ $deep = count(explode('/', $rsFolders_row['PI_ID'])); for ($i = $open_ul; $i > $deep; $i--) echo "</ul>\n"; $open_ul = $deep; if ($rsFolders_row['TYPE'] == 'Folder'){ echo '<li><span class="folder"><a href="#" rel="">'.$rsFolders_row['Title']."</a></span></li>\n"; echo "<ul>\n"; $open_ul++; } else echo '<li><span class="file"><a href="#" rel="">'.$rsFolders_row['Title']."</a></span></li>\n"; } for ($i=0; $i<$open_ul; $i++) echo "</ul>\n"; ?>
  20. where is SET command in your sql?
  21. i tell that swap quotes because "If the ANSI_QUOTES SQL mode is enabled, string literals can be quoted only within single quotes because a string quoted within double quotes is interpreted as an identifier." (from mysql manual)
  22. try $sql = "UPDATE $db_table SET Gold=Gold+".($_POST['Gold']+ 0).", PvP=PvP+".($_POST['PvP'] + 0).", Storage=Storage+".($_POST['Storage'] + 0).", Other=Other+".($_POST['Other'] + 0)." WHERE Name='".mysql_real_escape_string($_POST['Name'])."'"; remove , before WHERE
  23. remove last, blank line and error is go to line 92
  24. look shuffle() function
  25. try ... global $mainframe; $db =&JFactory::getDBO(); $query = "SELECT * FROM #__users"; $db->setQuery( $query, 0, $count ); $rows = $db->loadObjectList(); foreach($rows as $row) { for ($x = 0; $x < count($AuthorID); $x++){ if ($AuthorID[$x][0] == $row->id) { $AuthorID[$x][1] = "$row->name"; echo $AuthorID[$x][1]; } } } ... but is better to select all data in one query
×
×
  • 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.