hi guys i got this sqlite database which has only one 1 row called revenue_value and it has 2000 value. Lets say i click generate value button and generates 12 random number and i know rand will randomly generate values but all i want to know is can i control that randomness value for example - 2000 is the base value but at the end it has to end up with 20% higher than 2000 but in between value can go down or up.
i got the table working data.php
<?php
try
{
$db = new PDO('sqlite:randvalue.sqlite');
$db->exec("CREATE TABLE company (revenue_value INTEGER PRIMARY KEY)");
$db->exec("INSERT INTO company(revenue_value) VALUES ('2000')");
print "<table border=1>";
print "<tr><td>value</td></tr>";
$result = $db->query('SELECT * FROM company');
foreach($result as $row)
{
print "<tr><td>".$row['revenue_value']."</td></tr>";
}
print "</table>";
$db = NULL;
}
catch(PDOException $e)
{
print 'Exception : '.$e->getMessage();
}
?>
and the rest of the code is ajax.js which will echo it to index.php
any ideas guys
Aucun commentaire:
Enregistrer un commentaire