Jump to content

akitchin

Staff Alumni
  • Posts

    2,515
  • Joined

  • Last visited

    Never

Everything posted by akitchin

  1. i see a few issues. first, you never close the parenthesis on that first subquery. second, you have a several JOIN conditions that simply end with a table and no field: ON (t1.`employee_name` = lp0.) LEFT OUTER JOIN `employees` AS lp1 ON (t1.`gevity_number` = lp1.) lp0.what? lp1.what?
  2. merging a couple of gigs of avi's, huh? PORN MASHUPS FTW.
  3. that's simply a matter of assigning the array_pop() expression to a variable instead of echoing it: <?php $numberset = range(1,99); shuffle($numberset); $numbers = array(); for ($i = 1; $i <= 5; $i++) { $numbers[] = array_pop($numberset); } echo '<pre>'.print_r($numbers, TRUE).'</pre>'; ?>
  4. that's a very intensive way of doing it when you can use MySQL's built-in functions. try something like this: SELECT COUNT(*) AS total, payment AS payment_amount FROM table GROUP BY payment ORDER BY payment the total amount of money paid for each amount is simply the total multiplied by the payment amount. you could even put it into the query: SELECT COUNT(*) AS total_times, SUM(payment) AS total_paid, payment AS payment_amount FROM table GROUP BY payment ORDER BY payment
  5. that sucks. by christmas that thing will be about as outdated as a flock of seagulls haircut.
  6. we're going in circles here. when echoing the input tag to the browser, DON'T give them a variable variable name. this: "<input name="<? echo $rows['udu_id']; ?>[1][1]" type="text" />" should be: "<input name="question[<? echo $rows['udu_id']; ?>][1]" type="text" />" this will result in the structure i explained above, with output like this: <input name="question[10][1]" type="text" />
  7. is there a reason for having the extra key then? it looks entirely redundant, if you could just go: <input name="question[10][1]" type="text" /> <input name="question[10][2]" type="text" /> <input name="question[10][3]" type="text" /> <input name="question[25][1]" type="text" /> <input name="question[25][2]" type="text" /> <input name="question[25][3]" type="text" /> perhaps i'm missing something entirely here.
  8. it will all be in one gigantic array with the method i suggested. the first key will be the question number, the second key will be the sub-question: echo $_POST['group'][1][2]; // shows the response to subquestion #2 of question #1 the first foreach() will traverse through each individual question, and the foreach() embedded within the first will traverse through each subquestion in each question.
  9. it's looking like you'll need a multi-dimensional array here. use the group number as one key, and the input number as the second key: <input name="group[1][1]" type="text" /> <input name="group[1][2]" type="text" /> <input name="group[1][3]" type="text" /> <input name="group[2][1]" type="text" /> <input name="group[2][2]" type="text" /> <input name="group[2][3]" type="text" /> <input name="group[3][1]" type="text" /> <input name="group[3][2]" type="text" /> <input name="group[3][3]" type="text" /> to traverse through each group, you can use one foreach(), and to traverse through the inputs in each group, you can use a second foreach(): foreach ($_POST['group'] AS $group_number => $input_array) { echo 'this is group '.$group_number.':<br />'; foreach ($input_array AS $input_number => $input_text) { echo 'input number '.$input_number.' has a value of '.$input_text.'<br />'; } } give that a shot - just running that code should give you an idea of how foreach() and arrays work.
  10. i think s/he meant that they were a female.
  11. i couldn't have said it better myself.
  12. the total number of results found by the query is being run wrong.  you're using mysql_num_rows() which is a bit silly, because a COUNT() will only ever return one "row."  use mysql_result() to extract the correct result: [code]$sql = "SELECT COUNT(*) FROM members_cat WHERE categoryid='$cat_id'"; $result = mysql_query($sql) or die('count query failed for some reason.'); $total_results = mysql_result($result, 0, 0);[/code] hope this at least amends the total results found.  this line is also a little faulty: [code]echo "<font class='bodytext'>There are <b>$num_rows</b> professionals in this category</font><br><br>\n";[/code] $num_rows is just how many rows that page itself pulled.  $total_results is what you should be echoing in that line.
  13. it's probably because mysql_num_results() doesn't exist.  if you tried searching in the manual, you'd see one of its suggestions is mysql_num_rows().  could that be the vital clue?
  14. gradient kills the contrast, which i'm going to echo from the others.  copyright text at the bottom (and in retrospect, all the "title" text) is hard to read because it's a little dark and blurry.  the bevels and drop shadows are a little overused, and in my opinion they scream "i can follow tutorials!"  that might just be me, but the first thing i think when i see bevels and drop shadows is "looks like someone found the filters / layer effects menu." otherwise it looks good, albeit like the hundreds of other templates out there.  a little generic for my tastes, but i suppose that's what templates are meant to be.
  15. well you never know, some people don't have a sarcastic bone in their body. either way, i'm sure with a crowd like this, any config questions or issues should be addressable in the javascript forum.  i know that there are some configurations or tricks that aren't easily found in the manual, at least not without some trial and error.
  16. as far as i can tell, you'd want to do something like this: [code]SELECT table.username AS username, table.played AS played, table.won AS won, ROUND(won / played, 2) AS win_ratio FROM tables_used WHERE stuff ORDER BY win_ratio DESC, played DESC, username ASC[/code] this will grab all users with the highest win ratio first, and in the case of matching win ratios, will choose the one with the highest number of games played first (since i assume seniority ranks).  then it'll sort by username.  this may be oversimplified since it's easy to have a 1.00 win ratio when you're 1 for 1, so you may want to weight it by the number of games played somehow - nothing comes to me off the top of my head (i haven't done stats for a bit), but i'm sure a helpful statistician will pop up soon enough. [b]EDIT:  after some thought, unless you normalize all your ratios (that is, turn it all into a gaussian), i think the only way to ensure a relatively fair comparison of win ratios is to add a WHERE clause that makes sure the users have played more than x games.[/b]
  17. i'm having a hard time telling whether the sarcasm was totally missed, or totally volleyed.
  18. quickest way to check for query errors?  add die clauses to all of your query executions: [code]$var = mysql_query($query) or die ("problem with [$query]: ".mysql_error());[/code] change them to include those clauses and see what MySQL spits back at you.
  19. agreed with Daniel0.  i've used tinyMCE extensively, and it's much slimmer code than most, easier to deal with, and generates valid code if you tell it to.
  20. i don't know where that \" is coming from.  what does the query look like in the code?
  21. weird indeed.  looks to me to be about 32px in IE6win.
  22. i would recommend the following, although i'm neither a style nor an accessibility guru: verdana is good, but at lower sizes (10-11pt) arial is also good, my preference is again for lower sizes (10-11pt) tahoma isn't too bad those are usually the three i stick to, with arial being by far my most common.  i use times new roman on occasion, but only in large volumes of text to maintain readability.
  23. i don't see what you mean - they both appear at the same size in my IE and FF.  do you mean the positioning?  i notice FF's text is centered both vertically and horizontally, whereas IE is only horizontally centered.
  24. where are $image_id, $new_bid, $name and $email coming from?  the reason is ask is that, if they're from the form, in order to access them from the function you need to use $_POST['image_id'] instead, like so: [code]$sql = "select bid from plepictures where id='{$_POST['image_id']}'";[/code] i use the braces there so that the parser doesn't choke on the single quotes used in the index name. if you want to use them as local variables, you need to pass them to the function as arguments.  if you don't know how to do that, read a tutorial on writing functions.
  25. actually, the problem wasn't with your double quotes, it was the fact that you were missing a space between bid and from in the original query.  either change the quotes back to doubles in order to have $image_id interpolated into its value, or exit the single quotes: [code]$sql = 'select bid from plepictures where id='.$image_id;[/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.