-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript_pesquisarNoti.php
49 lines (40 loc) · 983 Bytes
/
script_pesquisarNoti.php
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
<?php
require_once('sc_conexao_banco.php');
if(isset($_POST['pesquisar'])){
//Pegar e filtrar valores tranmitidos via POST ou GET
$pesquisar = filter_input(INPUT_POST, 'pesquisar', FILTER_SANITIZE_STRING);
$consulta_sql = "SELECT
noti_id,
LEFT(noti_tit, 10) AS noti_tit,
LEFT(noti_txt, 10) AS noti_txt,
LEFT(noti_img, 10) AS noti_img,
DATE_FORMAT(noti_data, '%d/%m/%Y') AS noti_data,
usua_nome
FROM
tb_noti
INNER JOIN
tb_usua
USING
(usua_id)
WHERE
noti_tit
LIKE
'%".$pesquisar."%'
OR
noti_txt
LIKE
'%".$pesquisar."%'
OR
noti_data
LIKE
'%".$pesquisar."%'
OR
usua_nome
LIKE
'%".$pesquisar."%'
ORDER BY
noti_id DESC";
}else{
header("Location: index.php#noticias");
}
?>