Questions tagged as 'php'

1
answer

How to insert data in mysql via ajax + php + foundation 5

I wanted to know how I can enter data in MySQL via Ajax + PHP using the Zurb Foundation 5 Framework? Does the "data-reveal-ajax" property of the framework already override an insert Ajax function?     
asked by 12.01.2015 / 05:59
1
answer

I use setInterval X WebSockets

I'm developing a PHP application with AngularJS, in this application has a messaging system. I need only check the message quantity at least every 2 min. My doubts would be, would using the setInterval be recommended in this case, or would creat...
asked by 08.12.2014 / 16:56
1
answer

SQLSTATE 42000: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes with PHP

After I created the project with the command composer create-project --prefer-dist laravel/laravel laravel-scout I made the following changes in the .env file DB_DATABASE=course DB_USERNAME=root DB_PASSWORD=1234 Then I created the...
asked by 11.10.2017 / 19:53
3
answers

Why does the use of parentheses affect a mathematical expression combined with a concatenation?

Why this: echo "Você nasceu em ". (date('Y') - 20); //Retorna correto, no caso, se a idade for 20, retorna 1997 echo "Você nasceu em ". date('Y') - 20; // Retorna -20 Why in this particular case , with and without the parentheses, returns...
asked by 24.07.2017 / 15:44
4
answers

Limit text display in PHP

I want to limit the size of characters that appear, but I can not. Use o: <? echo $row["catname"] ?> It takes a text from phpMyAdmin and it shows, but I want to limit the display of characters on the page, how do I?     
asked by 19.07.2014 / 20:05
4
answers

How can several programs download XML from Brazilian NF-e?

I see that many websites and systems offer XML Download service issued by Brazilian taxpayers. Someone knows if there is a Technical Note "002/2012" that establishes a WebServices for downloading through events, but the deadline is 180 days...
asked by 12.05.2016 / 19:22
6
answers

How to mount the HTML of a "select" via PHP, using data coming from the DB

I'm having trouble rightly mounting a <select> within PHP, with data returned by mysqli . I tried this way: <?php $con = new mysqli("localhost", "root", "senha","bancodedados" ) or die (mysql_error()); $query = $...
asked by 01.07.2014 / 19:36
3
answers

Error: "You have an error in your SQL syntax" [closed]

I'm getting the following error when time to perform a query to insert data into a table in the database:    You have an error in your SQL syntax; VALUES ('Refined Sugar', '2', '') 'at line 1 My code: <html> <head>...
asked by 06.03.2014 / 01:48
2
answers

How to do line break of a string in PHP inside a div

I have a <div> that creates a box where I should print a PHP string from a database, but when the string is too large, instead of performing the line break the string would be "leaked" out of the box: Iwouldlikeabreakinthelineto...
asked by 19.04.2018 / 17:10
2
answers

Is it possible to concatenate a jQuery selector with a variable?

I have the following code inside a javascript function that is inside a .php page: if (indice_da_aba == -1) { window.alert('não existe ABAS AINDA'); } else if (indice_da_aba == 0) { $('a[href="#tab_00"]').tab('show')...
asked by 30.10.2017 / 20:34