sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
remove end while it's just remnark in pseudo code[code=php:0]<?php $row = mysql_fetch_array($result); while($row2 = mysql_fetch_array($result)){ ?> <tr id="<?php echo $row['statusid']?>" class="status"> <td><?php echo $row['date']?></td> <td id="<?php echo$row['statusid']?>" style="text-align:left;" class="editStatus"> <?php echo htmlspecialchars($row['statusTxt'], ENT_QUOTES)?></td> <td style="width:1%;"> <form action=""> <input type="image" src="img/cancel.png" onclick="makeVariable('<?php echo $row['statusid']?>')" class="deleteRowButton"/> </form> </td> </tr> <?php $row = $row2;?> <?php } $row=$row2; ?> <tr id="<?php echo $row['statusid']?>" class="statusLast"> <td><?php echo $row['date']?></td> <td id="<?php echo$row['statusid']?>" style="text-align:left;" class="editStatus"> <?php echo htmlspecialchars($row['statusTxt'], ENT_QUOTES)?></td> <td style="width:1%;"> <form action=""> <input type="image" src="img/cancel.png" onclick="makeVariable('<?php echo $row['statusid']?>')" class="deleteRowButton"/> </form> </td> </tr> <?php } ?> but i don't see any diferents for last row
-
try $row = mysql_fetch_array($result); while($row1 = mysql_fetch_array($result)){ echo data from $row $row = $row1; end while $row = $row1; echo data from $row (last row)
-
i see in another your post thet you want href wich start with 'CORPSEARCH.ENTITY_INFORMATION?' in that case use $patern ='/href="(CORPSEARCH\.ENTITY_INFORMATION\?[^"]*)"/'; preg_match_all($patern, $text, $html); $url =$out[1][0]; $sql="INSERT INTO links(cid, nlink)VALUES('','$url')";
-
href=" - literaly ( - start groupin [^"]* - any caracter diferant that " zero or more time ) - end gruping " - end caracter
-
$patern ='/href="([^"]*)"/'; preg_match_all($patern, $text, $out); print_r($out[1]);
-
Sessions to pass variables through pagination?
sasa replied to turpentyne's topic in PHP Coding Help
<?php session_start(); if(isset($_POST)){ $_SESSION['leafshape'] = $_POST['select1']; $_SESSION['leafcolor'] = $_POST['select2']; $_SESSION['leafvein'] = $_POST['select3']; $_SESSION['leafmargin'] = $_POST['select4']; } $leafshape = $_SESSION['leafshape']; $leafcolor = $_SESSION['leafcolor']; $leafvein = $_SESSION['leafvein']; $leafmargin = $_SESSION['leafmargin']; -
try $team_select = "SELECT @rank := @rank + 1 AS 'rank', t.team_id, t.team_name, COUNT(r.league_match_result_id) AS 'matches_played', SUM(IF(r.result='Win',1,0)) AS 'wins', SUM(IF(r.result='Loss',1,0)) AS 'losses', SUM(IF(r.result='Draw',1,0)) AS 'draws', SUM(IF(r.result='Win',3,IF(r.result='DRAW',2,0))) AS `points` FROM teams t LEFT JOIN league_match_results r ON r.team_id = t.team_id LEFT JOIN team_leagues tl ON tl.team_id = t.team_id RIGHT JOIN league_matches m ON r.league_match_id = m.league_match_id WHERE tl.league_id = :1 GROUP BY t.team_id ORDER BY team_name"; maybe is beter setup another table for points results an join it table points result points Win 3 Lost 0 Draw 2
-
foreach($colors as $c) echo implode('', $c), "<br />\n";
-
try <?php $test = array(1,'',2,3); $x = array_keys($test, ''); if(!count(array_keys($test, ''))) echo 'all filed'; else echo 'some empty'; ?>
-
let S be start and E end point x is walls xxxxxxxxx xxx x xxx x x x x x x E x xS x xx x x xxxxxxxxx replace S with 0 xxxxxxxxx xxx x xxx x x x x x x E x x0 x xx x x xxxxxxxxx in places near 0 put 1 xxxxxxxxx xxx x xxx x x x x1x x E x x01 x xx x1 x xxxxxxxxx in places near 1 put 2 xxxxxxxxx xxx x xxx x x x x1x x E x x012 x xx x12 x xxxxxxxxx end so on until is frespaces or you replace E xxxxxxxxx xxx x xxx x x4567 x x1x3x7E x x0123x7xx x1234567x xxxxxxxxx if you get E start with it and go to any place with number is smaler then number E go to next smaler until number 0 (point S) reverse path
-
$result = mysql_query("SELECT * FROM uploaded LIMIT 2");
-
sorry. i didn't read your code try while($c = fgetcsv($file_handle, 10000)) $colors[] = $c; print_r($colors);
-
look fgetcsv() function
-
error is in file jquery.min.js on line12 in IE8x64 try to move this file in head part
-
try <?php $test = range(1, 5); echo '<table border="3"><tr>'; foreach ($test as $data){ echo '<td width="100px">'; echo $data; echo '</td>'; } echo '</tr></table>'; ?>
-
rtrim($buffer,',');
-
change else if (isset($_POST['cmdSave'])) //Try to save items first. { $partidvar=trim($_POST['txtPartid']); $modelnumvar=trim(crProcmodelnum($_POST['txtModelnum'])); $modelnumvar=strtoupper($modelnumvar); $_SESSION['modelnum']=$modelnumvar; //Save for form display. $modelnumcatvar=trim(crProcprodname($_POST['txtModelnumcat'])); $newpartvar=$_POST['chkNewpart']; //from checkbox to mark part as NEW $prodcatvar=trim($_POST['cbxProdcat']); $prodnamevar=trim(crProcprodname($_POST['txtProdname'])); $prodsubnamevar=trim(crProcprodname($_POST['txtProdsubname'])); $footnotevar=$_POST['chkFootnote']+0; $newchkbrandarr=$_POST['chkBrand']; //Checkbox for each brand. $oldchkbrandarr=$_SESSION['oldchkbrandarr']; //Checkboxes before user changed them. $olddata=$_SESSION['olddata']; //Non-brand Fields strung together. $brandlist=$_SESSION['brandlist']; //List of brands displayed. crPrintarr('chkBrand raw',$_POST['chkBrand']); //DEBUG //Turn nulls in checkboxes to zeros. $cnt=count($newchkbrandarr); for ($j=0; $j<$cnt; $j++) { $newchkbrandarr[$j]=$newchkbrandarr[$j]+0; } //for j $newdata=$partidvar.$modelnumvar.$prodcatvar.$prodnamevar. $prodsubnamevar.$newpartvar.$modelnumcatvar.$footnotevar.$modelnumcatvar; to else $footnotevar=$_POST['chkFootnote']+0; $newchkbrandarr=$_POST['chkBrand']; //Checkbox for each brand. $oldchkbrandarr=$_SESSION['oldchkbrandarr']; //Checkboxes before user changed them. $olddata=$_SESSION['olddata']; //Non-brand Fields strung together. $brandlist=$_SESSION['brandlist']; //List of brands displayed. // crPrintarr('chkBrand raw',$_POST['chkBrand']); //DEBUG //Turn nulls in checkboxes to zeros. //$cnt=count($newchkbrandarr); $cnt = max(array_keys($newchkbrandarr)); for ($j=0; $j<=$cnt; $j++) { //$newchkbrandarr[$j]=$newchkbrandarr[$j]+0; if (!isset($newchkbrandarr[$j])) $newchkbrandarr[$j]=0; } //for j $newdata=$partidvar.$modelnumvar.$prodcatvar.$prodnamevar. $prodsubnamevar.$newpartvar.$modelnumcatvar.$footnotevar.$modelnumcatvar;
-
line elseif (isset($_POST['YB-Info'])); { shoud be elseif (isset($_POST['YB-Info'])) { remove ;
-
OK when you check rows 0, 1 and 5 in variable $newchkbrandarr is array(0 = >1, 1 => 1, 5 =>1) is it righr? after 1st for loop $newchkbrandarr is array(0 = >1, 1 => 1, 2 => 0, 5 =>1) is it right? in 2nd for loop you sum this array $cnt2 is 3 can you explain what you want?
-
is variable $id have value?
-
look soource of your form all chkboks is named name="chkBrand['0'] you must somewhere change value of variable $x
-
fgetcsv() function
-
change $tmp_rating = $row['rating'] / $row['votes']; to$tmp_rating = $row['votes'] ? $row['rating'] / $row['votes'] : 0;[/code]
-
you did not remove single qoutes around indexes in $_POST array
-
<?php $test = '<id>18800<end> <id>18436<end>'; preg_match_all('/<id>(\d+)<end>/',$test, $out); print_r($out[1]); ?>