Skip to content

Instantly share code, notes, and snippets.

@EVIL-SnaKe
Created November 9, 2010 21:59
Show Gist options
  • Save EVIL-SnaKe/669900 to your computer and use it in GitHub Desktop.
Save EVIL-SnaKe/669900 to your computer and use it in GitHub Desktop.
<?php
require_once ('db_login.php');
require_once ('db_connect.php');
/*$connection=mysql_connect($db_host, root, doom);
if (!$connection) {
die ("Невозможно подключиться к базе данных: <br/ >".mysql_error());
}
$db_select=mysql_select_db($db_database);
if (!$db_select) {
die ("Невозможно выбрать базу данных: <br/ >".mysql_error());
} */
function query_all($connection) {
// Записать текст запроса в переменную
$query= "SELECT * FROM main2";
// Исполнить запрос
$result= mysql_query($query);
if (!$result) {
die("Ошибка запроса: <br />".mysql_error());
}
//Получить и отобразить результаты
while ($row=mysql_fetch_array($result, MYSQL_ASSOC)) {
$date=$row["date"];
$start=$row["start"];
$end=$row["end"];
$name=$row["name"];
$avz=$row["avz"];
$tech=$row["tech"];
echo "<tr><td>$date</td>";
echo "<td>$start</td>";
echo "<td>$end</td>";
echo "<td>$name</td>"; ?>
<html>
<textarea name="input_title" rows="4" id="input_title" value="<?php echo $name; ?>"></textarea>;
</html>
<?
echo "<td>$avz</td>";
echo "<td>$tech</td></tr>";
}
mysql_close($connection);
}
?>
<?php
query_all ($connection);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment