Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. why is field receiptnum type varchar if you put number in it?
  2. no let see 1st condition strpos($currentuser['Skills'],"Accordion-") == "true" strpos return number 0 (start position of substring) when php compare number and string it convert string to number and get 0 == 0 => true (btw. "true" is not same as true) 1st condition can be strpos($currentuser['Skills'].'-',"Accordion-") !== false 2nd must be strpos($currentuser['Skills'].'-',"Bass (Upright)-") !== false and so on
  3. try <?php $array1 = array('info 1', 'info 2', 'info 3'); $array2 = array('thank you and welcome to what ever', 'the info you added * thanks for entering your info'); foreach ($array1 as $val) $array2[1] = str_replace('*', "* ".$val, $array2[1]); print_r($array2); ?>
  4. try to explode $currentuser['Skills'] with '-' and then use in_array() function
  5. $array_name[] = $cols->item(0)->nodeValue;
  6. try if($itemDescription[0] === "1") { $itemPrice *= 1.0625;//add 6.25 % mysql_query("INSERT INTO transactions (`itemDescription`, `itemPrice`, `bidderId`, `itemQty`, `totalPrice`) VALUES ('$itemDescription', '$itemPrice', '$winningBidder', '$totalDeals', '$totalPrice');"); $message1 = 'The transaction has been successfully added.'; }
  7. named your form fields as array in your input tags change name="s1" to name="s[1]" and so on
  8. this part of code[code=php:0]if($i < $max_columns) {     for($j=$i; $j<$max_columns;$j++)         echo "<td>&nbsp;</td>"; } ?> </tr> </table>[/code]shold be[code=php:0]if($i > 0) {     for($j=$i; $j<$max_columns;$j++) echo "<td>&nbsp;</td>";   echo '</tr>'; } ?> </table>[/code]
  9. change this part of code <td id="present"> <input type="radio" name="present<? echo $rows['STUDENT_ID']; ?>" checked="checked" value="PRESENT">Present </td> <td id="absent"> <input type="radio" name="present<? echo $rows['STUDENT_ID']; ?>" value="ABSENT">Absent </td> to <td id="present"> <input type="radio" name="present[<? echo $rows['STUDENT_ID']; ?>]" checked="checked" value="PRESENT">Present </td> <td id="absent"> <input type="radio" name="present[<? echo $rows['STUDENT_ID']; ?>]" value="ABSENT">Absent </td> and in action page yo can do foreach(S_POST['present'] as $student_id => $value){ //etc. }
  10. try <?php $test = array('key1'=>'test1', 'key2'=>'value2', 'key3'=>array('test','test1','test2')); function my_str_replace($srch, $replace, $subject){ if(!is_array($subject)) return str_replace ($srch, $replace, $subject); $out = array(); foreach ($subject as $key => $value) $out[$key] = my_str_replace($srch, $replace, $value); return $out; } $a = my_str_replace('test', 'hello', $test); print_r($a); ?>
  11. change for ($col = 0; $col < 5; $col++) { if (isset($serenwilde[$rw][$col])) { echo "<li>".$serenwilde[$rw][$col]."</li>"; } } to if (isset($serenwilde[$rw][0])) { echo "<li>".$serenwilde[$rw][0l]."</li>"; }
  12. in your INSERT query mysql_query("INSERT INTO topics (managerId, equip, title, url_big, url_small, egroup1, egroup2, egroup3, egroup4, egroup5, egroup6) VALUES ('$userid','$wordquip', '$equip', '$bigpic', '$smallpic', '$egroup1', '$egroup2', '$egroup3', '$egroup4', '$egroup5', '$egroup6')") or die (mysql_error("error 1321")); in fields list equip is on the 2nd position and in value list is 3rd
  13. try <?php $musername = '<font color="#ff0000"><u>Psycho</u></font>'; $name = strip_tags($musername); $parts = explode($name, $musername); print_r($parts); ?> btw you can't see html tags in browser - look in source kode
  14. change varijable $bgcolorplace to static try[/code]<?php function changebgcolor(){ static $bgcolorplace = 0; if ($bgcolorplace=="0"){ $bgcolorplace="1"; //$bgcolor="444444" echo("0 to 1<br/>".$bgcolorplace."<br/>");//display which part of code is executed 1 to 0 or 0 to 1(can never get the script to run this part), this line is temp/test code }else{ $bgcolorplace="0"; //$bgcolor="ffffff" echo("1 to 0<br/>".$bgcolorplace."<br/>"); //display which part of code is executed 1 to 0 or 0 to 1(It works), this line is temp/test code } } for($i=0; $i<10; $i++){ changebgcolor(); echo "<hr />\n"; } ?>[/code]
  15. try to change foreach ($players as $player) { to foreach ($players[1] as $player) {
  16. $query = "SELECT * FROM (SELECT statez, COUNT(statez) AS c FROM distributors GROUP BY statez) AS r ORDER BY c DESC";
  17. WHERE `ID` = '{$_POST['ID']}'") something gone wrong in copy paste
  18. remove ' from string $valid_chars_regex
  19. change WHERE `ID` = "{$_POST['ID']}'") to WH to ' ERE `ID` = '{$_POST['ID']}'") change " to ' before {
  20. foreach($results as $link) echo file_get_contents($link);
  21. function compare($x, $y) { if ( $x['repeat'] == $y['repeat'] ) return 0; else if ( $x['repeat'] < $y['repeat'] ) return -1; else return 1; } uasort($colors, 'compare'); print_r($colors);
  22. my cristal bowl sey: add ; in line before
×
×
  • 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.