Search for a MySQL record without using? id = id in the URL

0

guys, I'm trying not to use the $ _GET [] link, but I can not figure out how to do that. That is, instead of "site.com/?post=nome news" stay "site.com/nome-noticia". I already ran forums and in the Stack also behind a solution, but I did not find anything without adding the "? Post=" of the URL. The current code is this:

<?php
if(!@mysql_connect("localhost","root",""))
{
    die('ERRO NA CONEXÃO! --> '.mysql_error());
}
if(!mysql_select_db("site_novo"))
{
    die('NOME DB ERRADO--> '.mysql_error());
}
$video = $_GET['video'] ;
$videoId = $video;
$video_select = "SELECT * FROM video WHERE 'id_video'='$video_select'";
$query = @mysql_query($video_select) or die (mysql_error());

if (mysql_num_rows($query) <= 0) {
    echo 'ESSE VÍDEO NÃO EXISTE AINDA';
}else{
    $vd = mysql_fetch_assoc($query);
    include_once "../assets/include/head_video.php";
}?>

RESOLUTION

<?php 
if(!@mysql_connect("localhost","root",""))
{
    die('ERRO NA CONEXÃO! --> '.mysql_error());
}
if(!mysql_select_db("site_novo"))
{
    die('NOME DB ERRADO--> '.mysql_error());
}
$video = $_SERVER['PATH_INFO'];
$muda_path = explode('/', $video );
foreach( $muda_path as $video_link )
{
    $videoID = $video_link;
    $video_select = "SELECT * FROM video WHERE 'id_video'='$videoID'";
    $query = @mysql_query($video_select) or die (mysql_error());
}?>
    
asked by anonymous 21.10.2016 / 23:49

0 answers