Posts by Jorge B. • 11,427 points
255 posts
-
2
votes1
answer4263
viewsA: How do I open a submenu just by going over the menu?
just add the CSS: ul.nav li.dropdown:hover ul.dropdown-menu { display: block; } i.e., when you hover over (Hover) the menu li the submenu ul is shown (display: block;)…
-
2
votes1
answer55
viewsQ: onFling conflict with onSingleTapUp in Gesturedetector
I have an application running on Android with a Gridview (grid). On this grid I need to detect various events and so I’m using a gesture detector. Only by clicking on a grid item, sometimes the…
-
-1
votes3
answers447
viewsA: Search for more than one value in the same column?
You can use OR as has been said but can also do so with AND: WHERE YEAR(data_exame) >= 2015 AND YEAR(data_exame) <= 2016 or you can use the BETWEEN: WHERE YEAR(data_exame) BETWEEN 2015 AND…
-
19
votes3
answers10756
viewsA: What is a checksum for?
In a nutshell, the checksum serves to check, for example, if a file is exactly the same file after a transfer. To check if it has not been changed by third party or if it is not corrupted. The idea…
-
5
votes2
answers1589
viewsQ: How to nested Tables with bootstrap?
How can I nested Tables with bootstrap as in this example with ASP.Net? There is way to do this with bootstrap?…
-
25
votes3
answers1989
viewsQ: How do I know if the first digit of a string is a number?
I have a form where I need to validate the taxpayer number. If you start with PT or if it is a number without an acronym I validated by the Portuguese finance algorithm, otherwise I do not validate.…
-
3
votes1
answer59
views -
2
votes1
answer5886
viewsQ: How to place the current date and time in a datetime field?
I have a field date in a table that is of the type datetime and I want to put there the current date of my server. I’ve tried everything with NOW() in the insert SQL, but then I saw that it doesn’t…
-
0
votes2
answers800
viewsA: Navigation Drawer calling Activity - Close the menu by clicking on the Activity item if it is the current one
You can do it another way, add a rule in the manifest: <activity android:name=".Home" android:launchMode="singleTask"> So you won’t be recharging the same activity again.…
-
4
votes2
answers348
viewsA: Limit the database results?
To limit the number of results you can use the Mysql LIMIT: SELECT * FROM comentarios ORDER BY data DESC LIMIT 3;
-
0
votes4
answers352
viewsA: Error inserting json in Mysql with PHP
She’s simply missing one " in the code before the last parenthesis: $inserir = mysql_query("INSERT INTO table VALUES ('$nome', '$descricao', '$foto', '".$json."')"); As Wallace Maxters said and very…
-
4
votes1
answer104
viewsA: How to fetch messages from A to B and from B to A in the same query?
The problem is you’re going to get the outgoing messages, to get the incoming ones, just do it like this: SELECT * FROM user_inbox ta, (SELECT user_inbox_to, user_inbox_from, max(user_inbox_date)…
-
3
votes1
answer1918
viewsA: Add objects to the array
That’s because in your job insereProduto you are not using the class array, it should be like this: $this->carrinhoDao[] = $_produto; Or with an index depending on the id: public function…
-
3
votes3
answers223
viewsA: Multiple pages with a different id
From what I understand you want to click on the client menu to go to the script cliete.php but that the URL is home.php?id=1. You can put the URL of the client menu as home.php?id=1: <a…
-
0
votes2
answers3096
viewsA: How to put wipe button on android
You can do it programmatically like this: Button limpar = (Button) findViewById(R.id.Limpar); limpar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {…
-
3
votes1
answer1115
viewsQ: How to print on Android via a bluetooth printer?
I’ve been searching and found nothing about printing on Android through a Bluetooth printer. Is it possible to do this? Is there a library or SDK?
-
2
votes2
answers998
viewsA: Use HTML div and store it as a variable
You can use jQuery for that: $.post('exemplo.php', {var1: document.getElementById('1').outerHTML}); In PHP: $var1 = $_POST['var1'];
-
13
votes6
answers992
viewsA: Like saving today at the bank?
As @Wallacemaxters said just add CURRENT_TIMESTAMP in the field referring to the date: CREATE TABLE table_name ( data TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ); The ON UPDATE…
-
2
votes2
answers697
viewsA: Do SQL query in 3 tables and return the value to another table?
To insert the result of a SELECT in another table can do so: INSERT INTO D (descricaoA, descricaoB, descricaoC) SELECT A.descricao, B.descricao, C.descricao FROM A,B,C Table D has the following…
-
20
votes2
answers8235
viewsQ: How to place a clickable area on a piece of an image?
I have this code on my website: .fixed-background { position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; } img { height: auto; width: auto; min-width: 100%; min-height:…
-
3
votes3
answers3563
viewsA: mysqli_escape_string() expects Exactly 2 Parameters, 1 Given
This is because mysqli_real_escape_string requires 2 parameters to execute: mysqli_real_escape_string ( $link , $escapestr ); unlike the mysql_real_escape_string that only needed 1 parameter:…
-
4
votes1
answer80
viewsA: How to make this effect in css
img { background-color: blue; width: 200px; height: 200px; } .capa { width: 210px; height:…
-
7
votes3
answers121
viewsQ: How to avoid connection from stopping the application?
I have an Android app that sends data to a server via wireless, by sending changes from Activity B to A. It turns out that when the connection is weak the application stops and gives the error…
-
2
votes1
answer878
viewsQ: Why does creating the model not create Migration for me?
I’m starting at Laravel 5 and then this tutorial. By creating the model php artisan make:model Tarefa he does not create me to Migration in database/migrations/ as it would be supposed, someone…
-
3
votes4
answers1021
viewsA: Add minutes to the hour
You have to do the same for the minutes you made for the hours: var decalage = +1 var decalage_minute = 50 var d = new Date( ); //date //convert date timestamp function decalage_f( date, decalage,…
javascriptanswered Jorge B. 11,427 -
3
votes1
answer3367
views -
5
votes1
answer42
viewsA: Decrypting date
This is the date generated by the function time(). Returns the current time measured in the number of seconds since the Unix Age (January 1 1970 00:00:00 GMT). You can convert to normal date using…
-
3
votes2
answers69
viewsA: Phpmailer - Sending emails is possible?
What you can do here is create a table in the database with the emails that were not sent and by a cron every hour for example, or the interval you want to try to resend the pending emails.…
-
3
votes3
answers179
viewsA: Why ismysqli_ better thanmysql_?
I don’t think you have any idea what it is mysqli_ and mysql_. These are not different DBMS. They are libraries (extensions) of access to a Mysql database through PHP. The difference is that…
-
3
votes2
answers99
viewsA: Set roles for users stored in Database
I would do it in a very simple way with a user type table: CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, user_type_id INT,…
-
2
votes2
answers655
viewsA: Brazilian Army Scheduling System
I was able to solve your problem with array two-dimensional, because you need to know which day you choose and you wanted meals associated with that day. echo "$dia <input type='checkbox'…
-
1
votes3
answers751
viewsA: Problems with uploading images in PHP
I don’t advise you to save images directly in the comic book. You should have the images somewhere and in the comic book only the path for the image. To do this just use the function…
-
3
votes1
answer202
viewsA: How to create multiple tables at once?
You can just use the function mysqli_multi_query which allows you to execute several query at the same time. Example: $sql = "CREATE TABLE `medias_categoria` ( `id` int(255) NOT NULL AUTO_INCREMENT,…
-
4
votes1
answer1111
viewsQ: What is the difference between == and == in one condition?
What’s the difference between == and === in a condition, for example: if($string === $string2) and if($string == $string2)…
-
1
votes2
answers185
viewsA: Explode() 'manual' in PHP
You have to use the divideBy as array to give for all cases: function explode_by_me( $divideBy, $str ) { $element = ""; $elements = array(); $count = 0; $strCount = strlen( $str ); $divideCount =…
-
1
votes3
answers596
viewsA: How to select last related table records?
If I understand correctly it will be something like this: The query: SELECT COUNT(*) as count FROM negociacao_status as ns INNER JOIN negociacoes as n on n.negociacoes_status_id = ns.id INNER JOIN…
-
1
votes1
answer51
viewsA: Replace a text with an image
Yes you can do it like this: URL url = new URL("http://www.site.pt/url_da_imagem"); Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream()); imageView.setImageBitmap(bmp);…
-
4
votes0
answers66
viewsQ: How to put a background in a setup nsis?
I’m making a setup.exe for an application with the help of nsis and I’m compiling the same in Ubuntu. Now I wanted to customize the setup so that it appeared with background image like this: How can…
-
4
votes2
answers74
viewsA: Image with text
This is what you want? <img src="http://i.stack.imgur.com/A2VV7.png" align="right"> exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo exemplo…
-
2
votes2
answers937
viewsA: Bowling score in C;
For him to walk more than a house just increase the i when it’s not "STRIKE". #include <stdio.h> #define JOGADAS 20 int main(void) { int game1[JOGADAS] = {10, 9, 1, 6, 3, 7, 0, 8, 2, 0, 8, 2,…
-
4
votes1
answer1864
viewsA: I have a checkbox set but only wanted one selected
It’s simple enough to desiccate one CheckBox when you select the other: chkfemenino.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton…
-
10
votes5
answers2967
viewsA: Take all the names and put comma to separate them
You can do it like this: $sinal = ", "; $size = mysqli_num_rows($query1); $i = 1; while ($listintegrantes = mysqli_fetch_array($query1)) { if($i == $size-1) $sinal = " e "; elseif($i == $size)…
-
5
votes2
answers1348
viewsA: Update involving 3 tables
This is what you want? UPDATE A INNER JOIN B ON A.FK_TABELA_B = B.ID INNER JOIN C ON B.FK_TABELA_C = C.ID INNER JOIN (SELECT FK_TABELA_C, MAX( ID ) AS idMax FROM B GROUP BY FK_TABELA_C) T ON C.ID =…
-
2
votes1
answer91
viewsA: Choose database table for logged in user
You can solve this by having two tables, one for users and one for events User table | id | nome | ... |------------|-------------|----- | 1 | joaquim | | 2 | albano | | ... | ... | Event table | id…
-
3
votes1
answer7965
viewsA: Integrity Constraint Violation: 1048 Column 'name' cannot be null
Error means you are passing the value to the column nome to null and has this field defined in the table as NOT NULL. See if the variable $titulo is filled. $create->bindValue(':nome', $titulo,…
-
10
votes2
answers305
viewsA: I know the variable value, but the switch only goes to the default
I have tested and works your code well as you can see in this example so the problem has to be in the input which is passed on to $subsecao;. Do echo "::$subsecao::"; to check whether the input that…
-
2
votes2
answers497
viewsA: Media query messing up another media query
Kirito the problem is easy to see, some screen resolutions end up entering the two media. For example, 1680x1050 and 768x1024 fit the two in the media query: @media only screen…
-
17
votes2
answers1806
viewsQ: Why does a calculation with positive numbers give a negative result?
Why does this one count (100 * 22118400) / 44954676 in Java gives a negative number? -46 /* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import…
-
1
votes2
answers473
viewsA: SELECT with CASE runs on phpMyAdmin but does not pass in PHP
The problem is you’re missing spaces from one line to another, just like $query stays: SELECT `idforma_pagamento`, `habilitado`, `descricao`,CASE forma_pagamento.tipoWHEN 0... Adding spaces to each…
-
3
votes1
answer82
viewsA: Limit the number of clones
Just add a condition to the function mousedown in the if: || position_souris_x.length >=5 To put the no-drop just check in function onmouseup if you already have 5 elements: if(…