sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
use SHOW TABLES in sql look http://dev.mysql.com/doc/refman/5.0/en/show-tables.html
-
[SOLVED] Preventing simultaneous updates in MySQL
sasa replied to longtone's topic in PHP Coding Help
mysql_num_rows($result) = 0 is newer true -
change echo $array; to print_r($array);
-
move Group BY near the end
-
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); ?>
-
$deposit = ${'day'.$x} + ${'day'.$prev} + ${'day'.$next};
-
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);
-
no errors in this part can you post 5 line before error btw in which line is err
-
ops i just copy original code
-
change to $query = "SELECT * FROM `reminders` WHERE `done_status` = 'a' AND `physician` = ' ". $physician ." ' ORDER BY `check_date` DESC"; change ' to ` around fields names
-
change line foreach($_POST['del'] As $id){ to foreach($_POST['del'] As $id => $value){
-
echo $physician; add ; to end
-
<?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]; ?>
-
what have i done wrong eregi_replace please help cheers...
sasa replied to redarrow's topic in PHP Coding Help
$1 mean 1st (and only in this case) subpatern -
what have i done wrong eregi_replace please help cheers...
sasa replied to redarrow's topic in PHP Coding Help
<?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] -
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]); ?>
-
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>'; }
-
use html <pre> tag
-
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; ?>
-
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/"); }
-
you set $_SESSION['type'] and compare with $_SESSION['usertype']
-
can you print_r($_POST['title']); and post result
-
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"); }
-
but not inside function try to pass variable $file with function or make it global (global $file;) before use it
-
remove line 4 $my_array = mysql_fetch_array($resulta);