Jump to content

Barand

Moderators
  • Posts

    24,563
  • Joined

  • Last visited

  • Days Won

    822

Everything posted by Barand

  1. http://lmgtfy.com/?q=datepicker
  2. Easy there, .josh. You'll have me believing I should be charging more than five bucks an hour.
  3. You can also do it with javascript, changing the image's src attribute when there is an onmouseover event. Either way, it isn't a PHP problem
  4. Barand

    Sql issue

    SELECT COUNT(DISTINCT room_id) as rooms_booked FROM order WHERE MONTH(checkin) = $month If you want the number of room bookings rather the number of rooms the remove "DISTINCT" in the above query
  5. SELECT * FROM table WHERE column = anything is just SELECT * FROM table
  6. count returns the number of elements in an array. Reference the array in the same way as here http://forums.phpfreaks.com/topic/282534-extract-data/?do=findComment&comment=1451718
  7. Alternatively, you could connect twice to the user table (effectively treating on physical table as two logical tables). Use different table aliases and also different column aliases for the display name fields SELECT g.group_name, u1.display_name as admin, u2.display_name as super FROM group g INNER JOIN users u1 ON g.admin_id = u1.user_id INNER JOIN users u2 ON g.superadmin_id = u2.user_id
  8. You might also want to have a second array, by volunteer, so you can easily check the constraints on their shift allocations eg $shifts = array ( 0 => array ('vol1', 'vol2'), 1 => array ('vol3', 'vol4'), . . 27 => array ('vol3', 'vol28') ); $volunteers = array ( 'vol1' => array (0, 18), 'vol2' => array (0, 22), 'vol3' => array (1, 27), . . 'vol28' => array (20, 27) );
  9. Storing times as 6.30pm in a varchar column instead of 18:30 in a TIME type column is storing up problems for the future. You aren't just taking baby steps you are also putting on shackles.
  10. Which bit of your code are you having the problem with?
  11. Change your function to return the value instead of echo $val = 128; $places = $_GET['action']; $res = $val >> $places; $stored = p($res, $val, '>>', $places); function p($res, $val, $places, $note = '') { $format = '%0' . (PHP_INT_SIZE * 1) . "b\n"; return sprintf($format, $res); }
  12. No need for such extreme measures, self-flagellation will suffice.
  13. Great idea, Ch0cu3r. Just what I said in #3 above.
  14. First place to look for problems is those bits you have just changed
  15. If, OTOH, you want to replace the first 5 lines $file = "/server/path/location/code/backup/sendstats.conf"; $data = file($file); $data[0] = $new_data . "\n"; . . $data[4] = $other_data . "\n"; file_put_contents($file, join('', $data));
  16. Not quite. $naam = $mysqli->real_escape_string($naam);
  17. I suspect you need && instead of || in that condition NOT (A OR B) === (NOT A) AND (NOT B)
  18. As well as passing the $con parameter to the function you will also need to pass the $qd value that you want to insert
  19. 1. Write dates to database in Y-M-D format in DATE type column. Reformat on output. 2. Sanitize inputs to database with mysqli::real_escape_string(), not with htmlentities()
  20. Use concatenation $message = ''; while (whatever) { $message .= someData; }
  21. Just use a different CSS style for the fields with an error <html> <head> <style type="text/css"> input[type='text'].error { background-color: #FF0000; color: white; } </style> </head> <body> <form method="get"> Year: <input type="text" name="text" value="2013" size="6"> <br> Year: <input class='error' type="text" name="text" value="2o13" size="6"> <br> <input type="submit" name="btn" value="submit" class="error"> </form> </body> </html>
  22. Field names shouldn't be in single quotes anyway.
  23. It's better if your options all have different values though.
  24. $email = $row["TABLE1.EMP_EMAIL"]; Remove the table name and just use the column name. $email = $row["EMP_EMAIL"]; Same goes for the other fields
×
×
  • 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.