Posts by David Concha • 539 points
41 posts
-
1
votes1
answer418
viewsQ: From Json Object to Listview
Good afternoon to all, I have two classes, the bemVindo and the one that receives data in json and stores in an object and after the json data is received the class sends to the bemVindothe data…
-
3
votes2
answers228
viewsQ: Where to store the information?
I have an application in angular, basic with forms that stores the data in arrays and receives the dado in dados in div's. Now how can I store this data? What options have I been using Angularjs?…
-
0
votes3
answers131
viewsQ: Why am I only getting the first word from the database field?
The code below returns database values, but the field model only returns me the first word of the table field, the rest of the model name does not appear. What I am doing wrong? <?php…
phpasked David Concha 539 -
0
votes1
answer40
viewsQ: How to change the title of Webview
I am making an app in which I use a Webview. The doubt is how I can change the text that appears "Webviewapp" when I open the app.
androidasked David Concha 539 -
3
votes2
answers1549
viewsQ: Pass AJAX variable to php
I don’t have much experience in Ajax, I needed help. Here’s the thing, I have a form that validates the information with ajax. Now I wanted to enter this data in the database, as I can insert the…
-
1
votes1
answer424
viewsQ: Session values do not appear
Each user has a login with email and senha. I can log in and receive user session values such as username and the idade. In other user accounts, after login success, I don’t receive any value from…
phpasked David Concha 539 -
-1
votes1
answer885
viewsQ: Pass id to Modal Form from Bootstrap
I have a link that comes from a while in php and receives several lines of IDs. while puts id’s in the variable $dataid=$row['id']; Receive the IDs on the link $sql = "SELECT u.id, u.username,…
-
1
votes1
answer51
viewsQ: Repeat id query most times
I have two tables, one user and another visitas. On the table visitas i save the ID of the user that was visited and who visited. How to make a query where I leave users in order of more number of…
-
0
votes1
answer52
viewsQ: Send email to all registered
How can I send an email to each of the users registered in the database? This way I can only send to a user, in this case an email is sent to the last user of the comic. <?php…
-
-1
votes2
answers96
viewsQ: Validate username character number
I have the following validation for the username: if (empty($_POST["username"])) { $nameErr = "Username:Escolha um username."; } else { $uname = test_input($_POST["username"]); $v1 = 'ok'; if…
phpasked David Concha 539 -
-1
votes2
answers1709
viewsA: Recording variables in the database and how to retrieve them and assign value
To enter data into the database create a form with the necessary inputs. In the action of this form point to a file called insere.php. formulario.html <form action="insere.php" method="post">…
phpanswered David Concha 539 -
2
votes1
answer3802
viewsQ: How to end the user’s session if it closes page/tab?
When the user logs in, this user goes through the following check on all pages: if(!isset($_SESSION['start_login'])) { // se não tiver pego tempo que logou $_SESSION['start_login'] = time(); //pega…
phpasked David Concha 539 -
0
votes1
answer35
viewsQ: Protect other users' user options
I’m developing a system where every user has options to delete, add, or update, whatever. Let’s imagine that I, as a logged-in user with ID=6 have the options to delete one of my photos. When I…
phpasked David Concha 539 -
1
votes3
answers3076
viewsA: Refresh page when popup closes
I used so: //principal.htm <body onunload="window.opener.location.reload();"> //popup.htm <script>opener.location.reload(); window.close();</script>…
-
1
votes3
answers3076
viewsQ: Refresh page when popup closes
How can I update a page after closing a popup? After the user opens the popup, I give a series of options that change the page where the user opened the popup and need that updated page after the…
-
1
votes1
answer122
viewsQ: Change type of all table fields
You can change all fields in my table to VARCHAR? I have a table with plenty of fields and I wanted all fields to be automatically changed to type VARCHAR
mysqlasked David Concha 539 -
0
votes1
answer100
viewsQ: Redirect with successful/error messages
In my home I have certain options I give to the user. Each option is action a file in .php. After the user option is submitted and validated by the file .php i send the user to the redirected home…
phpasked David Concha 539 -
-2
votes2
answers1554
viewsQ: Chat with PHP, AJAX and Mysql
Good community. I am working on this chat system, very simple. I don’t understand why I don’t get messages in real time. I can only receive messages from another user if you close and open the div…
-
0
votes1
answer53
viewsQ: Keep chat chat chat chat feeds when switching to another page
Good community. I have a chat system, like fb. I’m using js, ajax and php. All right so far. It works. The only problem now is that I wanted to save the current chat Divs when switching pages. How…
javascriptasked David Concha 539 -
2
votes2
answers3956
viewsQ: Session time of the user
Good community. When the user logs in I add to the database the day and time this user logged in. The file init.php, which contains the login and which I use on all my pages I have put the following…
phpasked David Concha 539 -
0
votes1
answer22
viewsA: Join table photos to query
I resolved it this way: $sql = "SELECT u.id, u.username, u.genero, u.idade, u.local, u.descricao, u.status,u.last_login, u.photo_p_id, p.location, f.user_2_id, f.user_1_id FROM user AS u LEFT JOIN…
-
0
votes1
answer22
viewsQ: Join table photos to query
I have the following query that picks the user’s bookmarks ID=X $sql="SELECT * FROM user WHERE id IN (SELECT user_2_id FROM favoritos WHERE user_1_id =$id_user_logado)"; Now, how can I get the user…
-
0
votes0
answers33
viewsQ: Search from a form
I have a form with all the districts of portugal. When I select a city I do the search through the method post, get the value city and research shows everything that exists with the city…
-
0
votes1
answer143
viewsQ: CSS for A and B messages
I have the following span with messages exchanged between a user A and a B. How can I configure these spans to appear each on your line. The way I got the style of span it overwrites messages on the…
cssasked David Concha 539 -
4
votes4
answers3915
viewsQ: Knowing if there are blanks
Good community! I have the following doubt. How can I alert the user that there are blanks in the field username? This is how I’m validating username now: if (empty($_POST["username"])) { $nameErr =…
phpasked David Concha 539 -
1
votes2
answers54
viewsQ: Display user messages
I have two tables, one of utilizadores where I keep the usernameand the id, and I have another chat where I keep the fields sender and the reciever, which are the user id of the user who received…
-
0
votes1
answer509
viewsQ: Friends system in PHP and SQL
I have a problem and I haven’t found the solution yet. I have 2 tables, one of users and another of friends. In the user table I store the id and the username On the table of friends I have the…
-
0
votes3
answers4197
viewsQ: Select from two tables without repeating data
I have two tables, one for users and one for photos where each line contains the user id of the respective photo. I want to select the user data and grab the photos by the user id of the photos…
-
0
votes1
answer639
viewsQ: Send textarea text to div
Good community, I have the following script that takes text from the textarea and places it inside a div after ENTER. $(document).ready(function(){ $('textarea').keypress( function(e){ if (e.keyCode…
javascriptasked David Concha 539 -
1
votes1
answer666
viewsQ: Session variable "balance" does not update
I have a problem that’s never happened to me before. My balance session variable does not update on the .php. page.It is updated in the database after an UPDATE. But on the page is only updated if I…
-
1
votes2
answers1222
viewsQ: Pass input value to another page
I have a page where I receive in a table values from the database. echo "<tr>"; echo "<th>Empresa</th>"; echo "<th>Categoria</th>"; echo "<th>Serviço</th>";…
phpasked David Concha 539 -
-1
votes2
answers91
viewsQ: LEFT JOIN with three tables gone wrong
because this query is returning me all the elements of the table offer_pro I want and only the table id offers? is not taking the elements title, description, value, user_of, categ, location, fav,…
phpasked David Concha 539 -
3
votes2
answers321
viewsQ: Inner Join 3 tables
I have the following appointment. $cmd = "SELECT ofertas.id, ofertas.titulo, ofertas.descricao, ofertas.valor, ofertas.user_of, ofertas.categ, ofertas.local, ofertas.fav, favoritos.id_oferta FROM…
-
0
votes2
answers79
viewsQ: Refresh with php
I have a button that adds the value +1 in the database and shows the total of "Likes" that the article already has. <a class='btn' href=portal/fav.php?id=".$produto['id']."> <span…
phpasked David Concha 539 -
0
votes2
answers2923
viewsA: if (isset($_POST) Do something, if not another
if ($_POST['visib'] == '1'){ //<---- Acrescentei o que faltava $sql2 = "INSERT INTO ofertas_pro (titulo, descricao, valor, user_of, categ, local) VALUES ('$titulo', '$descricao',…
phpanswered David Concha 539 -
0
votes2
answers2923
viewsQ: if (isset($_POST) Do something, if not another
I’m here with a little problem that shouldn’t be a big deal... I have a form where I have two radio Buttons, and depending on the selection of one of them, the query will be different. If the value…
phpasked David Concha 539 -
3
votes1
answer64
viewsQ: How to know the line number on which the ID was displayed
Okay, here’s the problem. I have a while taking values in the database: ... while ($produto = mysql_fetch_array($produtos)) { echo "<tr>"; echo "<td>".$produto['id']."</td>"; echo…
phpasked David Concha 539 -
1
votes4
answers1630
viewsA: Validate, if already exists does not INSERT
In case someone has a similar problem, this is my code: //verifica se já existe $query = mysql_query("select * from favoritos where id_user='$login_session' AND id_oferta='$id'", $connection); $rows…
phpanswered David Concha 539 -
2
votes4
answers1630
viewsQ: Validate, if already exists does not INSERT
I have the following code that records in the database the id of an article that the user "liked". $sql = "INSERT INTO favoritos (id_user, id_oferta) VALUES ('$login_session', '$id')"; if…
phpasked David Concha 539 -
1
votes4
answers886
viewsQ: Select data from two tables
I’m having trouble relating data from two tables. I have two tables. Posts table and Favorites table. Tabela Favoritos: id, id_utilizador, id_post 1 109 20 2 200 20 3 105 104 4 109 150…
phpasked David Concha 539 -
2
votes1
answer606
viewsQ: Check if a value is present in an array
I have a table in my database with several numbers. I take the numbers from the database, store them in a array, and do echo in a PHP table: echo "<table class='CSSTableGenerator'>"; echo…