I am writing a Telegram-bot
There is a table
name | sum | rain Название1 | 153 | NTS Название2 | 145 | Название3 | 142 | NTS Название4 | 135 | NTS Название5 | 178 | So I select rows with the same value, let's say the answer I have SQL finds 2-3 lines, maybe more.
SELECT `name`, `sum` FROM `buyd` WHERE `rain`='NTS' I need to send a formatted message of this type.
Название1 153 Название3 145 Название4 178 I assign a permen
$query = mysql_query("SELECT `name`, `sum` FROM `base` WHERE `rain`='".$rain."'"); $array = mysql_fetch_array($query); $sum = $array[1]; $name = $array[0]; I want one variable to print in this format, if at all possible.
Bring in response
apiRequest("sendMessage", array('chat_id' => $chat_id, "text" => "$name $sum"}
while($array = mysql_fetch_array($query)) { echo $array[0] . "\t". $array[1]."\n" }while($array = mysql_fetch_array($query)) { echo $array[0] . "\t". $array[1]."\n" }- splash58