I was searching for the answer but I couldn't found one for the specific problem, someone says something about ajax or json but I have no idea how to use this things, so I decided to ask a question.
Actualy I'm saving the values from a skill calculator in mysql using php/mysql and jquery for the calculating.
What I need at moment is take a number from mysql and use it as variable, maybe somthing like this:
ranksalvo[0] ==
<?php
mysql_select_db("skill");
$query = mysql_query("SELECT * FROM skillrank WHERE ID = '71' ");
$rows = mysql_fetch_array($query);
$rank1 = $rows['rank1'];
?>;
if(ranksalvo[0] == 1){
$('.archerrank2').slideDown(1000);
}
As you can see its just a very bad example, but I think it shows exactly what I want also why I couldn't find a good enough answer when I was searching it.
Thank you!
<form action="conexao/conexao.php" method="post">
<script src="jquery.js"></script>
<script type="text/javascript">
var ranksalvo = [0,0,0,0,0,0];
var skillsalvo = [0,0,0,0,0,0];
var ranksalvo[0] =
<?php
mysql_select_db("skill");
$query = mysql_query("SELECT * FROM skillrank WHERE ID = '71' ");
$rows = mysql_fetch_array($query);
$rank1 = $rows['rank1'];
echo "$rank1";
?>;
if(ranksalvo[0] == 1){
$('#rank1s').slideDown(1000);
$('#rank2s').slideDown(1000);
$('#rank3s').slideDown(1000);
$('#rank4s').slideDown(1000);
$('#multishot').slideDown(1000);
$('#fulldraw').slideDown(1000);
$('#swiftstep').slideDown(1000);
$('#kneelingshot').slideDown(1000);
$('.archerrank2').slideDown(1000);
}
</script>