Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. use SHOW TABLES in sql look http://dev.mysql.com/doc/refman/5.0/en/show-tables.html
  2. change echo $array; to print_r($array);
  3. sasa

    merge arrays

    try <?php function ar_add_fit($arr, $add){ $t = array_merge($arr, $add); sort($t); $i = 0; $out = array(); $tmp = array(); while (in_array($t[$i], $add)){ $out[] = $t[$i]; $i++; } for (;$i < count($t){ $k = $t[$i]; $tmp[$k] = array(); $i++; while (in_array($t[$i], $add)){ $tmp[$k][] = $t[$i]; $i++; } } foreach ($arr as $k){ $out[] = $k; foreach ($tmp[$k] as $v) $out[] = $v; } return $out; } $colorAry = array('grn1', 'grn2', 'grn3', 'blue1', 'blue2', 'red1', 'red2', 'red3', 'org1', 'org2'); $altcolorAry = array('grn1a', 'blue1a', 'red1a'); shuffle($colorAry); $y = ar_add_fit($colorAry, $altcolorAry); print_r($y); ?>
  4. $deposit = ${'day'.$x} + ${'day'.$prev} + ${'day'.$next};
  5. try foreach ($tables as $table) { $query_midI[] = "UNION SELECT DISTINCT `ID`, $table.`freq`, $table.`offset`, $table.`pl`, $table.`loc`, $table.`call`, $table.`state_id`, counties.`county_name`, $table.`use` FROM $table INNER JOIN counties ON $table.county_id = counties.county_id AND $table.state_id = counties.state_id WHERE $table.`op_status` NOT LIKE '4' AND (`freq` LIKE '%$keyword%' OR `loc` LIKE '%$keyword%' OR `call` LIKE '%$keyword%' OR `use` LIKE '%$keyword%' OR `affil` LIKE '%$keyword%' OR `features` LIKE '%$keyword%' OR`coverage` LIKE '%$keyword%' OR `sponsor` LIKE '%$keyword%' OR `system` LIKE '%$keyword%' OR `comments` LIKE '%$keyword%' OR `nets` LIKE '%$keyword%' OR `gps` LIKE '%$keyword%' AND $table.`state_id` LIKE '$state_id')"; } $query_midI = implode(' ', $query_midI);
  6. no errors in this part can you post 5 line before error btw in which line is err
  7. ops i just copy original code
  8. change to $query = "SELECT * FROM `reminders` WHERE `done_status` = 'a' AND `physician` = ' ". $physician ." ' ORDER BY `check_date` DESC"; change ' to ` around fields names
  9. change line foreach($_POST['del'] As $id){ to foreach($_POST['del'] As $id => $value){
  10. echo $physician; add ; to end
  11. <?php $a = 'http://www.XblahXblah.com/someplace/else/id/551478/track.php?&url=http://www.XanotherXblahXblah.com'; preg_match('/url=([^&]+)/' ,$a, $b); echo $b[1]; ?>
  12. <?php $img="[img=http://www.google.co.uk/intl/en_uk/images/logo.gif]"; $x=preg_replace("/\[img\](.*)\[\/img\]/", "<img src='$1' />",$img); echo $x; ?>f/code]
  13. try <?php $text = 'Hey, I found a cool pic! [img=http://www.url.com/image.jpg] bla [img=http://www.url2.com/image2.jpg]'; preg_match_all('/\[img\](.+?)\[\/img\]/', $text, $url); print_r($url[1]); ?>
  14. try foreach($res as $x) $w[] = " upper(tags) LIKE upper('%$x%') "; $w = implode('OR', $w); mysql_select_db("games") or die(mysql_error()); $result = mysql_query("SELECT `title`,`type`,`game_picture_url` FROM `game` WHERE $w")or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ echo '<center><table width ="150px"><tr><td>'; echo '<a href="game.php?title='; echo $row['title'].'">'; echo '<IMG SRC="gamepic/'; echo $row['game_picture_url']; echo '"'.' WIDTH="90"'.' HEIGHT="90"></a></td>'; echo '<td class="search_game_info"><a href ="game.php?title=';//start of link code echo $row['title']; echo '">'; echo $row['title']; echo '</a></br>';// end of link code echo '('; echo $row['type']; echo ')</td></tr></table>'; echo '</td></tr><tr><td>'; }
  15. try <?php $tags = 'car, motor, automobile, gas, drive, road'; $tags = explode(',', $tags); $num = count($tags); $i = 0; while ($i < $num){ $name = 'var'.($i + 1); $$name = trim($tags[$i++]); } echo $var3; ?>
  16. try if(($tru) && (!mysql_fetch_row(mysql_query("SELECT round FROM {$tab['game']} WHERE round='$tru' AND starts<$time AND ends>$time;")))) { header("Location: $site[location]play.php/"); }
  17. you set $_SESSION['type'] and compare with $_SESSION['usertype']
  18. can you print_r($_POST['title']); and post result
  19. try if ($_SESSION['usertype'] == "2" && $logged == true) //remove '' { header("Location: ../Admin_files/start.php"); } else if ($_SESSION['usertype'] == "1" && $logged == true) // ad $ and remove '' { header("Location: ../Main Page/first.php"); }
  20. but not inside function try to pass variable $file with function or make it global (global $file;) before use it
  21. remove line 4 $my_array = mysql_fetch_array($resulta);
×
×
  • 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.