Posts by Christopher Tavares • 325 points
23 posts
-
0
votes1
answer57
viewsA: How to pass the value of a "$variable" coming from another page, and use it in a select PDO
try the following: $consulta = $pdo->prepare("select unidade from unidades_administrativas A join users B on A.id = B.id_unidades where B.user = :usuario;"); $consulta->bindParam(':usuario',…
-
0
votes0
answers44
viewsQ: Bug or logic error
Hello, I am solving a question that is a routine in my life, grab csv and popular database. I took a demand where I need to take the first 21 columns of 32 csv files and group everything into a…
phpasked Christopher Tavares 325 -
3
votes1
answer545
viewsQ: Problems when exporting from PHP to CSV
I’m having trouble visualizing a CSV file. My intention is that I can use the Excel command "data to column" and stay row by row, but the file has skipped line impossible. The code was made based on…
phpasked Christopher Tavares 325 -
3
votes1
answer142
viewsQ: Problems with autoload
am starting an application applying mvc. I created Composer.json with the following autoload parameters: "autoload":{ "psr-4":{ "SOCIAL\\":"vendor/SOCIAL/", "App\\":"App/", "Predis\\": "src/" } have…
phpasked Christopher Tavares 325 -
0
votes0
answers69
viewsQ: Join array to Json output
Hello, I’m having doubts how could I join this 4 array’s with the relationship between them. I have the page hierarchy -> post -> comments -> reply. I need to associate the posts to the…
-
0
votes3
answers1525
viewsA: How to create HTML elements with Javascript?
It would look like this in a simplified way: var $div-text= document.querySelector('.div-text'), // Pega a string do conteúdo atual HTMLTemporario = $div-text.innerHTML, // Novo HTML que será…
-
2
votes2
answers2146
viewsA: Is it possible to connect a C-based application to a database?
If there is like, Postgresql even uses many functions in C and has a library for it. Just add #include You will need to find out where the libpq-fe file is. h, then, when compiling the program, we…
-
1
votes2
answers426
viewsA: Is there a way to break in If?
Yes, the argument passed on break you go out of a level. If you have a foreach and an if: foreach ( $var as $key ) { if ( $key == 0 ) { #code... break(2); } } This way vc interrupts also the…
-
1
votes1
answer916
viewsQ: Problems with PHP Json Encode?
something strange is occurring in the output of my function. When using var_dump only in the variable it returns key and value normally. Piece of code: public function buildGender() { $unknow_name =…
-
0
votes4
answers703
viewsA: Validate facebook profile URL
Returning the user id has a certain difficulty, if it is the public name the above way will solve you if you have the url input. If you need the real user ID, I suggest using the gift and…
-
-1
votes1
answer52
viewsQ: Doubt with array search
my question is the following: How do I search a key and return its value? Ex. $contagem = array('metodologia' => '1','facilidade' => '10') would like to search for ease and return the value…
-
3
votes2
answers244
viewsQ: How to sort array decreasingly?
I have the following problem, after making a array `push, I want to return the amount of repetition of a term for this: $key =…
-
0
votes1
answer77
viewsA: Foreach returns no value
Try declaring variables to be null before foreach. Enable error return on PHP tb variables, it may help in the solution.
-
-2
votes3
answers17426
viewsA: How to pass javascript variable value to php?
Use an Hide text element with a unique id. Or open and close the PHP tag with echo in value. But you have to take into account the HTML creation order in the browser.
-
0
votes0
answers40
viewsQ: Error inserting Multiple PHP + PDO + POSTGRESQL Lines
I am using Multiple Insert, but the internal characters of the text have caused Insert to fail. I used the addslaches method in the string but the error remains, some hint of what I can do to…
-
0
votes0
answers30
viewsQ: Database Entering even without PHP script execution
Hail!!! I have a PHP script that breaks sentences in array and inserts word by word in BD. Until then all right, the bid starts when even without the script being active or session it remains…
phpasked Christopher Tavares 325 -
1
votes1
answer79
viewsA: Like postgres PDO with foreach
If someone goes through the same problem follows how I managed to solve: $arr = array('a', 'b', 'c'); foreach ($arr as $a){ $this->SQL = "update client set active=1 where date between ? and ? and…
-
0
votes1
answer79
viewsQ: Like postgres PDO with foreach
I need to use a like in foreach but without success, I did as follows: $arr = array('\'%a%\'', '\'%b%\'', '\'%c%\''); foreach ($arr as $a){ $this->SQL = "update client set active=1 where date…
-
1
votes1
answer71
viewsQ: Return mongodb Collections in json_encode PHP
I am assembling a REST API in PHP and I am not able to display all the returned Collections of the Mongo search, returns only one. Follow the code for those who can make a contribution I will be…
-
0
votes1
answer621
viewsQ: Handle query postgres errors
Using PDO and Postgres, but with difficulty to get the query Exception, for example error in syntax. I’m grateful if anyone can shed some light!!
-
0
votes0
answers50
viewsQ: PHP stopping inserting in the table
I have an application that works with facebook activity log, I have 150 pages in monitoring, and I do the daily insertion of these lines: Post Comment Reply Likes Shares It has reached 500,000…
-
2
votes1
answer87
viewsQ: Problem with urllib3 and Twitter API
Save Coderos on duty I’m using this source for twitter API https://github.com/geduldig/TwitterAPI When running the error examples: File "stream_tweets.py", line 1, in from Twitterapi import…
-
4
votes4
answers158
viewsQ: Passing argument by PHP array
Save everyone, I have the following function exec($dia, $mes, $ano); would like to make a foreach to run it through a base in array. I passed the following way $a=array("1,2,2016",…
phpasked Christopher Tavares 325