-
Posts
24,563 -
Joined
-
Last visited
-
Days Won
822
Everything posted by Barand
-
http://lmgtfy.com/?q=datepicker
-
Sending time to mysql as 6:43 p.m. (for example)
Barand replied to mystic7's topic in PHP Coding Help
Easy there, .josh. You'll have me believing I should be charging more than five bucks an hour. -
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
-
SELECT * FROM table WHERE column = anything is just SELECT * FROM table
-
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
-
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
-
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) );
-
Sending time to mysql as 6:43 p.m. (for example)
Barand replied to mystic7's topic in PHP Coding Help
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. -
Which bit of your code are you having the problem with?
-
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); }
-
No need for such extreme measures, self-flagellation will suffice.
-
Great idea, Ch0cu3r. Just what I said in #3 above.
-
First place to look for problems is those bits you have just changed
-
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));
-
Not quite. $naam = $mysqli->real_escape_string($naam);
-
I suspect you need && instead of || in that condition NOT (A OR B) === (NOT A) AND (NOT B)
- 6 replies
-
- undefined index
- php
-
(and 1 more)
Tagged with:
-
As well as passing the $con parameter to the function you will also need to pass the $qd value that you want to insert
-
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()
-
Storing results from a while loop into a variable?
Barand replied to wright67uk's topic in PHP Coding Help
Use concatenation $message = ''; while (whatever) { $message .= someData; } -
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>
-
It's better if your options all have different values though.
-
$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