-3
Follows the code:
$selbanco = "SELECT * FROM exemplo WHERE id=5";
$querybanco = mysql_query($selbanco);
while($teste=mysql_fetch_array($querybanco)){
$testando = $teste['teste'];
}
<td id="idcampo"> ><?php
if($teste1>$teste2){
echo "$testando";
}
else {
echo "(Agurde)" </td>
<script>var exemplo = $("#idcampo").html();</script>
$exemplo = "<script>document.write(exemplo)</script>";
echo $exemplo;
When displaying this example variable with echo
it returns "example example" , it would have some command or something you can use to return only "example" without repeating the word?
Note: The variable taken in the database is duplicated ("example example")
show me where is the answer to my question ?
– Matheus Rocha
Exactly in your previous question. The fact that you don’t understand doesn’t make it not duplicate. Just use the answer code you yourself accepted, and apply before the
echo
. I would suggest you elaborate your questions better, here everyone wants to help, but if you do not explain it well, it is difficult. I hope you understand that to get an answer that solves your problem, it is critical that you can explain it properly.– Bacco
The answer does not work for this question as I capture the variable in a different way, the code given in the previous question DOES NOT ANSWER THIS QUESTION.
– Matheus Rocha
It serves, but you’re getting lost when mixing PHP with JS.
– Bacco
so I’m asking for help, if I didn’t need help I wasn’t here
– Matheus Rocha
implemented the code and it continues to duplicate the variable, IT DOES NOT SERVE.
– Matheus Rocha
So then you have to help us and put the problem exactly as it really is. If you keep throwing questions in half, the whole community is wasting their time with things that don’t fit. And like I said, if you don’t know the first thing about what you’re doing, it’s not the community’s fault. Anyway, if anyone understands you’re not a duplicate, just vote to reopen. It is suggested that you create a [mcve], and then we can help on top of it.
– Bacco
So I created this question, to explain the problem correctly, because I had already accepted the answer in the other and after accepting it n would change the question.
– Matheus Rocha
And did you accept it without serving? Notice that you are misusing community resources. Like I said, if you try to use it more carefully, it’ll be better for you and for us. What I’m trying to tell you is to help you too. Just what you put here in the question, the problem remains the same. If it doesn’t fit, click the [Edit] on this one, and explain your problem with a functional example of the problem.
– Bacco
I accepted because the code was correct, and when tested separately it worked, but when incrementing to the rest of the n code it worked more
– Matheus Rocha
Then edit this one with all your code and the one that makes it easier for us to help.
– Bacco
reopen please seeing that the previous answer n serves for this question n there is a duplicate question here
– Matheus Rocha
You have to make it not duplicate. The way it is, the problem is the same. You can [Dit] at any time adding what you tried to do, then it is easier to find the error. Put the code already with the part that gives problem and what used the other and did not work. Then we will probably find the error more easily.
– Bacco
You’ve improved a bit, but you missed the part of the other answer, no?
– Bacco
Look, I voted to reopen so as not to cause any more trouble, but try to understand what I said, which makes it easier for you and us. The way it is, I still don’t think it can be solved, so see what you can do to make it easier for those who are helping to understand the real problem. See this as a way for you to help those who help you with answers.
– Bacco
I got the code if I can find the problem now I’d appreciate it
– Matheus Rocha