All Questions

1
answer

Focus when starting the page

What is the best way to get an element to focus as soon as the page loads     
asked on 25.08.2016 / 15:59
6
answers

Code refactoring to convert GPS coordinates in DMS format into an array

You can enter the GPS coordinates in two ways, Decimal Degrees or Degrees, Minutes, Seconds : ┌─────────────────────────────────┬─────────────────────┐ │ DMS (Degrees, Minutes, Seconds) │ DD (Decimal Degree) │ ┌────────...
asked on 10.01.2014 / 17:09
1
answer

When to use module.exports or exports in Node.js?

I'm starting my study with Node and I came across the two ways to export something so that it is available with require , I would like to know what is the best way and why. Thank you     
asked on 20.03.2015 / 04:02
3
answers

Get MAC Address from the application's client machine

I would like to know the best way to get the client MAC Address from my Asp.Net Web Forms application. Since it's low-level information, I do not think it's as simple as it sounds.     
asked on 18.02.2014 / 20:16
2
answers

=, BINARY, LIKE, LIKE BINARY, REGEXP, SQL binary collation

Reformulation of the question from @GabrielHenrique's answer and search: What is binary collation in a string column in the table? BINARY serves to make a case-sensitive search and LIKE case-insensitive, then LIKE BINARY...
asked on 03.03.2018 / 14:48
2
answers

Is there a way to create cross platform programs in C ++?

I'm programming C and I'm learning Java now, but I really enjoyed learning C ++ and I wanted to know if it's possible to create cross platform programs, that is, to run on any OS without having to compile the code in each OS.     
asked on 08.06.2016 / 21:39
2
answers

___ ___ erkimt Error in MySQL "expects parameter 1 to be resource, boolean given in" ______ qstntxt ___
%pre%

I have this code and can not see error in it, but it gives me this error. I know there should already be a topic of this on the site but I have tried all the ways and nothing. Give me the bool error (false)

    
______ azszpr28190 ___

This error happens when %code% or %code% fails, it is usually a syntax error in the sql query and returns a %code% as explained in manual . For mysql_fetch _ * () to function properly you must pass a variable of type %code% or %code% which is the return of %code% / %code% on success.

To fix the error you can force mysql_ * mysqli _ mysqli _ to display the database error with the mysql_error () or mysqli_error ()

Version with old mysql functions _ *

%pre%

Version with mysqli_ * procedural

%pre%

Version with mysqli_ * OO

%pre%

The query will return this error because %code% is a reserved mysql word.

  

Error Code: 1064. You have an error in your SQL syntax; check the   manual that corresponds to your MySQL server version for the right   syntax to use near 'desc'

The other way is to print the query and test directly at the database:

%pre%

Related:

Why should not we use functions of type mysql_ *?

MySQL vs PDO - which is the most recommended for to use?

How to print the SQL statement being sent to the bank?

    
______ azszpr333477 ___

The problem occurs because the %code% method needs a parameter with the connection to the database.

I leave an example below. Remember to modify the data to connect to the bank.

I leave it as a hint for you to study using the PDO because it is safer and the %code% is already depreciated.

  

Example:

%pre%     
___

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked on 07.08.2014 / 19:13
1
answer

XSS attacks, how does it happen?

Recently a client has been the victim of XSS attacks. We treat all inputs that we encounter with faults, but I can not understand how malicious javascript code was inserted into the .js files on the server. How did you change the script via X...
asked on 28.03.2014 / 15:27
1
answer

What is the use of "= delete" in the declaration of a C ++ constructor?

I came across a declared constructor as follows: State(const State& em) = delete; Does anyone know what = delete is at the end of the signature of the counter?     
asked on 22.03.2018 / 19:18
1
answer

What is OData for?

I've gotten caught up with some people talking about OData , I did some research I saw some codes, but I was not clear about some things, What is OData for? What are the advantages and disadvantages? When to use OData? When not...
asked on 17.03.2018 / 19:59