Jump to content

Barand

Moderators
  • Posts

    24,566
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by Barand

  1. What is the form method of the form that contains your username2 input? Is it POST?
  2. Still waiting to know what's being sent by your ajax request Example...
  3. Does this simple script work? <?php echo file_put_contents("ValidationsRedeemed.txt", 'This is a test' . "|", FILE_APPEND); ?> (It should output 15 to the browser and add "This is a test|" to your file)
  4. Personally, I'd go with file_put_contents('filename', 'content', FILE_APPEND); So much easier than fopen(), fwrite(), fclose().
  5. Alas, {}s are part of the variable variable syntax edit: $a = 'foo'; $$a = 'bar'; echo $$a; //--> bar echo ${$a}; //--> bar echo $foo; //--> bar
  6. @ginerjm those currency symbols need escaping otherwise they are interpreted as variable variables ($$price, $$number) <td>\${$price}</td> <td>\${$number}</td>
  7. Which variable doesn't echo out. They all do for me once I put something in them. (BTW, You should've learnt to use code tags by now.)
  8. A single = is an assignment operator, so if ($validation = "true") assigns the string "true" to $validation. In your second code example you are checking equality correctly but your are checking if it is equal to the string value "true". This will suffice... if ($validation) { as this means "if validation is true"
  9. Sounds like you're not doing it correctly.
  10. SELECT school , city , TRIM(REPLACE(school, city, '')) as new_school FROM school;
  11. If you have a syntax error elsewhere in the script (and it sounds like you have) then it will not run at all, so your error reporting statement cannot be executed. Error reporting needs to be defined in the php.ini file.
  12. As I obviously cannot run the script to see for myself, perhaps you would be kind enough to give me an example of the data being passed. My main concern is the structure of your code. You are running a query to get an array of ids and then looping through that resulting array to run queries based on those ids. Running queries within loops is extremely inefficient. You should be running a single query which joins the tables on those ids to get the data you require.
  13. OK, so ff() returns an array of the user's friend ids. The next uncommented line is foreach ($update_id1 as $i => $v) { What does $update__id1 contain (there doesn't appear to be a prior reference)?
  14. in the code foreach ($array as $i => $v) $i = index of the current element $v = value of the current element You use a function ff() as in $ids= ff($f, $project); but I can't see it defined anywhere. What does it do? Then I'll have some idea of what the data in $ids looks like.
  15. Please use the "code" icon for code, not the "quote"
  16. Then tell us what the code you posted is supposed to do.
  17. Why don't you post your actual code (that code won't execute past the first line) and tell us what you are trying to achieve, not just how you are failing to do whatever it is.
  18. You also need to output the value into the html from php <FORM METHOD="POST" ACTION="SCAction.php/?cmd= set&var1=<?=$SC2?>">
  19. The values in the forms input fields get sent to the action php file, so put it in one. Use a hidden field if you don't want it visible.
  20. Why don't you simplify things and rotate and compress in one single operation?
  21. He's testing for 0 or 1. 0! and 1! both equate to 1, so no need to calculate any further. Every recursive function needs a stop condition otherwise you quickly overflow the stack with an infinite recursion.
  22. I was assuming that a report_filed meant they attended. But, yes, you could mysql> SELECT weekofyear(start_time) as wkno -> , SUM(is_no_show=0 AND is_cancelled=0) as attended -> , SUM(is_no_show=1) as no_shows -> , SUM(is_cancelled=1) as cancellations -> FROM heartstring -> GROUP BY wkno; +------+----------+----------+---------------+ | wkno | attended | no_shows | cancellations | +------+----------+----------+---------------+ | 40 | 2 | 0 | 0 | | 41 | 0 | 1 | 1 | | 42 | 1 | 0 | 0 | | 43 | 0 | 1 | 0 | +------+----------+----------+---------------+
  23. Weird! When I ran this based on https://imgur.com/a/kYwmuO1 I got +------+----------+----------+---------------+ | wkno | attended | no_shows | cancellations | +------+----------+----------+---------------+ | 40 | 2 | 0 | 0 | | 41 | 0 | 1 | 1 | | 42 | 1 | 0 | 0 | | 43 | 0 | 1 | 0 | +------+----------+----------+---------------+
  24. Oh great! I love pictures. Where? You're not giving many clues if you want help.
×
×
  • 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.