-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexcelOutput.php
More file actions
62 lines (45 loc) · 1.18 KB
/
excelOutput.php
File metadata and controls
62 lines (45 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
session_start();
include_once 'dbconnect.php';
if(!isset($_SESSION['user']))
{
header("Location: index.php");
}
global $HOSTDB; // Host name
global $USERDB; // Mysql username
global $PASSDB; // Mysql password
global $NAMEDB;
$coo = mysqli_connect ( $HOSTDB, $USERDB, $PASSDB, $NAMEDB );
if (! $coo)
{
die ( 'Could not connect: ' . mysqli_error ( $coo ) );
}
else
{
if (! mysqli_connect_error ())
{
$coo->set_charset ( "utf8" );
$result = mysqli_query ( $coo, "SET CHARACTER SET 'utf8';" );
$result = mysqli_query ( $coo, "SET SESSION collation_connection = 'utf8_persian_ci';" );
//query for texts
$query = "SELECT * FROM text";
$result = mysqli_query ( $coo, $query );
if ($result)
{
if ($result->num_rows > 0)
{
$cntr = 0;
$AllTexts = array ();
while ( $mrow = mysqli_fetch_assoc ( $result ) )
{
$AllTexts [$cntr] = $mrow;
$cntr ++;
}
}
}
}
}
for($i = 0; $i < count ($AllTexts); $i ++) {
echo strip_tags($AllTexts[$i]['LabeledText'], '<a>');
}
?>