-
Posts
24,603 -
Joined
-
Last visited
-
Days Won
830
Everything posted by Barand
-
The last line of the query looks odd ...ORDER BY sala_ocupacao.`id_ocup`id_ocup;'
-
instant validation using php arrays using ajax or jquery
Barand replied to tarquino's topic in PHP Coding Help
your code to create the array $car = array(); $car["vw"] = array( "name" => "volkswagen"); $car["tyta"] = array( "name" => "toyota"); will give you Array ( [vw] => Array ( [name] => volkswagen ) [tyta] => Array ( [name] => toyota ) ) It would be better and simpler to $car = array(); $car["vw"] = "volkswagen"; $car["tyta"] = "toyota"; giving Array ( [vw] => volkswagen [tyta] => toyota ) But why not just give them a dropdown menu of valid types to select from -
God Himself couldn't get this table to the top of the page
Barand replied to ZandarKoad's topic in PHP Coding Help
I was thinking Imperial Purple, but then Gold. -
No, you don't want it to look like that. You should not use "SELECT * " and numeric values should not be quoted. What is the relationship between "start" and "end" that you pass to your script via the URL and "bidStatus" and "department"
-
displaying mysql data to a html page after submit
Barand replied to OGBugsy's topic in PHP Coding Help
The last insert id is only available for the current connection. You need to get it and store it ($_SESSION) as soon as possible after the insert. When the script ends the connection closes automatically -
how to echo Variable within html that is within a php code?
Barand replied to adamsevera's topic in PHP Coding Help
Change your single quotes to double quotes and vice versa -
God Himself couldn't get this table to the top of the page
Barand replied to ZandarKoad's topic in PHP Coding Help
Looks like you'll be losing your blue badge. What colour is the "God" badge? -
You are selecting four columns but show only three in the output image ??? I don't know your data structure or content so can only guess, but would a LEFT JOIN instead of INNER JOIN on `req_material_tempo` give the desired result?
-
On reading this post I was considering embarking on a natsort function with a custom collation sequence but chickened out. I decided I could live with natsort()'s default. I wish gnomeplanet luck in creating one. If they ever bring back the competitions, this would be a good contender
-
Have you tried natsort
-
Replacing a select drop down with images in php
Barand replied to totallytech's topic in PHP Coding Help
Try stepping through the relevant JS code in your browsers debugger and try to find where an "undefined" value is being sent to the ajax call. -
Replacing a select drop down with images in php
Barand replied to totallytech's topic in PHP Coding Help
Are you using javascript to pass the value? -
I'm guessing you could also do it using SVG text.
-
You removed the echo. It used to be echo json_encode($response); So it should still echo $response;
-
Your PHP doesn't echo anything to go into the response (unless you have a query error).
-
See my previous reply. AFAIK CSS doesn't support outline font-style so you may need to specify an outline font.
-
If "Wno" in your table is the week number then use "... WHERE Wno BETWEEN 1 AND 13" in your query to get the first quarter and not rely on LIMIT
-
Replacing a select drop down with images in php
Barand replied to totallytech's topic in PHP Coding Help
Give us a clue - what exactly is reported as being "undefined"? -
You can't in PHP. You use CSS on the client. EG <html>> <head> <style type="text/css"> body { font-size: 24pt; } </style> </head> <body> <?php echo "Hello World";?> </body> </html>
-
Why json_encode plain text? As you are already using jquery, why use getElementById() and not $('#ajaxDivOk').css("display", "block"); $('#ajaxDivOk').html("Registo(s) gravado(s) com sucesso");
-
I can't see a reason for 1000+ writes in the code posted. Is that code inside another loop?
-
What does $hora (or $_POST['hora']) contain?
-
try $a = [1,2,3,4,5,6,7,8,9,10]; $b = [1,4,7,9,10]; $c = array_fill_keys(array_keys(array_diff($a,$b)),null) + $a; ksort($c); result: $c = Array ( [0] => 1 [1] => [2] => [3] => 4 [4] => [5] => [6] => 7 [7] => [8] => 9 [9] => 10 )
-
Do you mean you can't access the keys of the outer array? $someArray = json_decode($newObject, true); foreach($someArray as $obj=>$value){ foreach ($value as $secondKey){ echo $obj . " " . $secondKey . "<br>"; } } gives firstObject red secondObject blue