Posts by William Alvares • 584 points
25 posts
- 
		2 votes1 answer394 viewsA: How to always update by adding+1 to mysqlSolved!! This is what I’d do: "UPDATE tb_comment SET good=good+1 WHERE id=:idComment" mysqlanswered William Alvares 584
- 
		3 votes1 answer394 viewsQ: How to always update by adding+1 to mysqlHello, How do I update a mysql column by always inserting +1 with each new update? And how to take -1 from the same column ? I tried that: "UPDATE tb_comment SET good=+1 WHERE id=:idComment" Only… mysqlasked William Alvares 584
- 
		0 votes1 answer74 viewsQ: What is the logic to make this select work?How do I make this select display according to what is selected there among the options 'Most recent, Rating, Utility'?: The most recent would be the last comments added! The Evaluation would be the… 
- 
		0 votes1 answer394 viewsA: How to make an INSERT inside the whileSolved!! I just swapped the _POST for the ID of each comment!! $idComment = id de cada comentário if(isset($_POST[$idComment])) 
- 
		0 votes1 answer394 viewsQ: How to make an INSERT inside the whileHello, How do I insert into a loop where id of the comment = id of the comment look at the code $selecionarComentarios = $conexao->prepare("SELECT a.id_mark, a.id_user, a.comment, a.rate, a.id,… 
- 
		-1 votes2 answers90 viewsA: How do I upload the image and delete the old one?$novoNome = $img; if(isset($_POST['edit_profile_avatar'])) { if(!empty($_FILES['img']['name'])) { // INICIO UPLOAD IMG //INFO IMAGEM $file =… 
- 
		-4 votes2 answers90 viewsQ: How do I upload the image and delete the old one?How do I delete old image and upload new image? The code I’m using uploads, only the old and current image is in the folder... $novoNome = $img; if(isset($_POST['edit_profile_avatar'])) {… 
- 
		-3 votes1 answer47 viewsQ: How to take 0. out of PHP roundHow do I get this one 0. of the account below.. $idMark = 6; $rating[5] = 4; $bar5estrelas = ($ratings[5] == 0) ? 0 : round(($ratings[5]/$idMark), 2); Resultado: 0.67 As the retreat the 0. leaving… phpasked William Alvares 584
- 
		0 votes1 answer38 viewsQ: How I do the valuation accountI’m going crazy here already trying to figure out how I do the account to get result for me to make a pub Progress this way. There in the 5 star bar has 100% in the 4 has 20% as I get these results.… phpasked William Alvares 584
- 
		0 votes1 answer1698 viewsQ: CSS and Javascript files do not load when I use Amigavel URLHello, I’m trying to create URL Amigavel and even worked in some pages only in some is not working CSS, JS etc.. I’m using this in . htaccess: <IfModule mod_rewrite.c> RewriteEngine On… 
- 
		5 votes3 answers825 viewsQ: Make the page refresh and the message appear nextHello, How do I send a contact form for example, refresh the page and display the sending message? Code: Javascript: function showAlert(type, message) { if (message !== '') { if (type === '') { type… 
- 
		3 votes1 answer503 viewsQ: How do I create a variable to display error or success message?How do I display error messages in a variable, for example: Executed the code all right then has to appear the first message: if($count==1) { // PRIMEIRA MENSAGEM $change_profile_msg[] = "<div… phpasked William Alvares 584
- 
		5 votes1 answer3743 viewsA: Login using PDOChange this line: $validarlogin->bindValue(":senha", md5($_POST['email'])); To: $validarlogin->bindValue(":senha", md5($_POST['senha'])); You are using the encryption algorithm in the 'email'… 
- 
		-1 votes1 answer153 viewsQ: How to use password_hash in selectHow do I login with the entire encrypted password ? I used password_hash and now for me to log in as I do ? if(isset($_POST['loggin'])) { $user = trim(strip_tags($_POST['user'])); $txtpassword =… 
- 
		0 votes1 answer45 viewsQ: How I select all records from the tableHow do I select all records in select below: $select = "SELECT COUNT(1) AS id_mark, SUM(a.rate) AS rate, b.name_mark, b.id FROM tb_comment a, tb_mark b WHERE a.id_mark=b.id AND b.id_category=:id_c… 
- 
		-4 votes1 answer636 viewsQ: Why use session_cache_limiter()I should use session_cache_limiter() ?? why ?? Values: nocache, private, private_no_expire or public. phpasked William Alvares 584
- 
		6 votes1 answer40 viewsQ: Is there a problem using HTML 5 attributes instead of jQuery or Javascript?Is there some security issue or something like using only attributes, like required in inputs, among others, instead of jQuery? Or it’s just some option to use jQuery to customize the message only?… 
- 
		3 votes1 answer399 viewsQ: How to improve a star rating code?I’m with a website and certain points hold me, as this evaluation, is not very cool this script, someone fit can improve for me or tell me what can improve, to make the code more organized, check if… 
- 
		-1 votes4 answers582 viewsQ: How do I SELECT then INSERTHow do I select and return more than 1 record does the UPDATE and return 0 records does the INSERT ? Look how I did it here only it’s not working: if(isset($_POST['submit'])){ $query =… 
- 
		0 votes3 answers639 viewsA: Align 4 Ivs always horizontally, with size proportional to screen size<div class="x"> <div class="DIVV"> </div> <div class="DIVV"> </div> <div class="DIVV"> </div> <div class="DIVV"> </div> </div> .x { width:… 
- 
		2 votes1 answer63 viewsQ: How I select several values from the same tableHow do I select the values 1, 2, 3, 4 and 5 of the same table without doing that lot of SELECT ? <?php $rateone = 1; $ratetwo = 2; $ratethree = 3; $ratefour = 4; $ratefive = 5; $query = "SELECT… 
- 
		-2 votes2 answers90 viewsQ: Destroy Session when changing profile on mobile and affect pcHello, How do I solve the problem when someone edit the profile on mobile and at the same time is logged in on the pc, do not give php error as 'Undefined variable' on the pc because the data is no… 
- 
		4 votes2 answers369 viewsQ: How to add everything in MYSQLHow do I sum everything from a table in Mysql for example.. I have the table tb_comment, then I want to add in each post(id_mark) the amount of rate it will have in total. For example the id_user 20… 
- 
		4 votes2 answers287 viewsA: How do I index my app in Google searches?Add your URL by accessing link: https://www.google.com/intl/pt-BR/add_url.html 
- 
		2 votes2 answers4834 viewsQ: How to check in the database if the registration has already been made PDOHow do I check if the id user no longer has registration in the database and continue with the insert? if(isset($_POST['submit'])){ $comment = trim(strip_tags($_POST['comment'])); $insert = "INSERT…