Created
October 28, 2010 10:01
-
-
Save EVIL-SnaKe/651051 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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></tr>"." "; | |
echo "<td>$start</td>"." "; | |
echo "<td>$end</td>"; | |
echo "<td>$name</td>"." "; | |
echo "<td>$avz</td>"." "; | |
echo "<td>$tech</td><br>"; | |
//</table> | |
} | |
mysql_close($connection); | |
} | |
query_all ($connection); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment