Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. try[code]... $num_rows = min($max_num_rows,mysql_num_rows($list_result)); echo "<table border=\"1\">\n<tr>"; for ($i = 0 ; $i < $max_num_columns; $i++) echo "<td width=197><div align='center'><strong>name/nom + #</strong></div></td><td height=17 width=21><strong>Girl</strong></td><td height=17 width=21><strong>Guy</strong></td>"; echo "</tr>\n";[/code]
  2. try[code] while ($srow = mysql_fetch_array($sresult)) { $currentsub = $srow['sub']; echo '<tr> <td>&nbsp;&nbsp;'.$currentsub.'</td> <td>&nbsp;&nbsp;&nbsp;<input name="catsub[]" type="checkbox" id="1" value="'         .$cat.'$$$'.$currentsub. // or use $crow['id].'$$$'.$srov['id']         '"><br> </td> </tr>'; //echo '<INPUT type="hidden" name="id" value="'.$srow['id'].'"> //<INPUT type="hidden" name="sub" value="'.$srow['sub'].'">'; }[/code]an i head [code]$user_id = $_GET['id']; if (!empty($_POST['mcsubmit'])) { if(isset($_POST['catsub'])) { foreach($_POST['catsub'] as $catsub) { $cs = explode('$$$',$catsub); $category = $cs[0]; $checked = $cs[1]; $ssql2 = "SELECT * FROM categories"; $sresult2 = mysql_query($ssql2) or die ('could not connect'); $scount2 = mysql_num_rows($sresult2); $srow2 = mysql_fetch_array($sresult2) ; $category = $srow2['cat_id']; echo $category; $doquery = mysql_query("INSERT INTO users_sub (user_id, user_sub) VALUES ('$user_id', '$checked')") or die ("could not insert"); $doquery1 = mysql_query("INSERT INTO users_cat (user_id, user_cat) VALUES ('$user_id', '$category')") or die ("could not insert1"); $doquery2 = mysql_query("INSERT INTO users_categories (user_id, user_cats, user_subs) VALUES ('$user_id', '$category', '$checked')") or die ("could not insert2"); } } } ?>[/code]
  3. change to [code]if ($x < $num_records) {   $y = mysql_result($list_result, $x, 'name');   $z= "+" . mysql_result($list_result, $x, 'number');   $col2 = '&nbsp;';   $col3 = '&nbsp;'; } else {   $y = '&nbsp;';   $z = '&nbsp;';   $col2 = 'Girl';   $col3 = 'Guy'; } echo "<td>$y $z</td>"; echo "<td>$col2</td>"; echo "<td>$col3</td>";[/code]
  4. change Make payments with PayPal - it's to Make payments with PayPal - it\'s
  5. add to your qwery ORDER BY casts.yearID then set $year1='-456'; or samting that is not posible in your print loop after set variable do samthing ike this[code] if ($year != $year1){ $year1 = $year; print "<tr><td colspan=\"2\">In $year, $castmember was in the cast with:</td></tr>"; } [/code] i make litle changes
  6. call function before echo, thet set variable
  7. try[code]echo '<a href="title.php?id_parent='.$result['title'].'"> ' . $result['title'] . ' </a>';[/code]
  8. you have $row[0] and $row['subject'] try print_r($row);
  9. must be[code]if( isset($_POST['page']) && !empty($_POST['page']) && ctype_digit($_POST['page']) ){[/code]
  10. change line[code]$result = mysql_query("SELECT COUNT(*) FROM listarchive WHERE date = ".$_GET['date']." AND club = ".$_GET['club']." ");[/code]to[code]$result = mysql_query("SELECT COUNT(*) FROM listarchive WHERE date = '".$_GET['date']."' AND club = '".$_GET['club']."' ");[/code]add some '
  11. add [code]if (isset($_POST)) foreach ($_POST as $k => $v) $$k = $v;[/code] after 1st '<?php' (line 12)
  12. sasa

    PHP Error

    or[code] $forumz = array(1 => 'Announcements',                       2 => 'General Discussion',       3 => 'Newbie Help',       4 => 'Fun And Games',       5 => 'Non-Game',       6 => 'Game Help'); if ($user[uRank==3]) {   $forumz[7] = 'Staff General';   $forumz[8] = 'Staff bug report'; }[/code]
  13. try[code] select year*10000+month*100+day as date where date > 20060601[/code]
  14. try to change <form method='post' action='edit.php'> to <form method='post' action=''> or <form method='post' action='edit.php?shirt_id=$shirt_id'>
  15. OK i find the error try[code] echo "<option value=\"$row2[asset_type]\""; if(isset($_POST['asset_type']) AND in_array($row2[asset_type], $_POST['asset_type'])) print " selected = \"selected\""; echo ">$row2[asset_type]</option>";[/code]
  16. try[code] echo "<option value=\"$row2[asset_type]"; if(isset($POST['asset_type']) AND in_array($POST['asset_type'], $row2[asset_type])) print "selected = \"selected\""; echo "\">$row2[asset_type]</option>"; [/code]
  17. or[code] <?php function i2b ($a){ $i = -1; while (($x = pow(2,++$i)) <= $a) if ($a & $x) $out[$i] = $x; return $out; } $out = i2b(55); echo array_sum($out),' = ',implode(' + ',$out); ?> [/code]
  18. sorry i make mistake row[code]while ($row = mysql_affected_rows($rwsult))[/code]must be[code]while ($row = mysql_fetch_array($result))[/code] not $rwsult  ???
  19. try[code] $query = "SELECT COUNT(employee_num) AS num, location FROM users WHERE userlevel = '1' GRUP BY location'"; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_affected_rows($rwsult)) echo "<font face='Tahoma' size='2'>There are total of <b>$row['num']</b> employee's in the <b>$row['location']</b> plant</font><br />"; [/code]
  20. try[code] <?php mysql_connect("", "", ""); mysql_select_db(""); $result = mysql_query('Select count(*) from your_table'); $num_records = mysql_result($result,0,0); $max_num_rows = 48; $max_num_columns = 2; $per_page = $max_num_columns * $max_num_rows; $total_pages = ceil($num_records / $per_page); if (isset($_GET['page'])) $page = $_GET['page']; else $page = 1; $start = ($page - 1) * $per_page; $result = mysql_query("select info from your_table limit $start, $per_page"); $num_columns = ceil(mysql_num_rows($result)/$max_num_rows); $num_rows = min($max_num_rows,mysql_num_rows($result)); echo "<table border=\"2\">\n"; for ($r = 0; $r < $num_rows; $r++){ echo "<tr>\n"; for ($c = 0; $c < $num_columns; $c++){ $x = $c * $num_rows + $r; if ($x < $num_records) $y = mysql_result($result, $x, 'info'); else $y = '&nbsp;'; echo "<td>$y</td>"; } echo "</tr>\n"; } echo "</table>\n"; for ($i=1;$i <= $total_pages;$i++) { if ($i == $page) echo " $i "; else echo " <a href=\"?page=$i\">$i</a> "; } ?> [/code]
  21. i use php 4 if string start with number PHP convert string in this number, if start with no number simbol it convert it in 0 (not '0') try[code] <?php if(12 == '12pm') echo '12 = 12pm '; else echo '12 != 12pm '; if (12 == '12 + 6') echo '12 = 12 + 6 '; else echo '12 != 12 + 9 '; if(12 == 'pm12') echo '12 = pm12 '; else echo '12 != pm12 '; if (100 == '1E2') echo '100 == 1E2'; else echo '100 != 1E2'; ?> [/code]
  22. You compare number with string PHP convert string into number and it is equak 0 try[code] if ($data == "data1") { $rowNum = "$row"; } [/code]
  23. try[code] <?php $after = 3; // number of weeks $look_day = 4; // 0 is Sun, 1 is Mon etc $t=time(); $d = date('w'); $after = ($d >= $look_day) ? $look_day - $d + $after * 7 : $look_day - $d + --$after * 7; $t_new = $t + 86400 * $after; echo date('D d. M Y',$t_new); ?> [code][/code][/code]
  24. insert in form [code] <input type="hidden" name="page" value="sermonsarvhice"> [/code]
×
×
  • 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.