Answer the question
In order to leave comments, you need to log in
How to set new variables with values from the database?
Hello,
you need to select records from a table by date (datee column)
and using a cycle (I don’t know any other way) create variables and write data to them from the received request .
For example
, if we select for 2015-09-16
then
$prost1 = 23:52:00;
$proend1 = 00:25:00;
$prost2 = 00:00:00;
$proend1 = 00:00:00;
$prost3 = 00:00:00;
$prost4 = 00:00:00;
$query=mysql_query("SELECT * FROM $mes WHERE datee='2015-09-16'");
$arr=mysql_fetch_assoc($query);
$i=0;
foreach ($arr as $key) {
${"num{$i}"} =$key["prost"];
echo 'N'.$i.' '. ${"num{$i}"}.'<br>';
$i++;
}
Answer the question
In order to leave comments, you need to log in
These are mutually exclusive paragraphs:
VDS is such a thing where you set it up yourself, you follow it yourself. Therefore without the administrator it is impossible.
Take better VIP-shared hosting, not VDS type. This is a common shared type, but only your server is inside the VDS, that is, the performance is the same as on the VDS.
https://ruweb.net/hosting/vip
Decided like this:
$query="SELECT * FROM $mes WHERE datee='2015-09-16'";
$result=mysql_query($query);
$i=1;
while ($row = mysql_fetch_assoc($result)){
$shablon->setValue('N'.$i,$row["num"]);
$shablon->setValue('PT'.$i,$row["prost"]);
$shablon->setValue('PD'.$i,$row["proend"]);
$shablon->setValue('PS'.$i,$row["prosum"]);
$shablon->setValue('IT'.$i,$row["intst"]);
$shablon->setValue('ID'.$i,$row["intend"]);
...
$i++;}
$shablon->save($anketaFile);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question