PHP - 从SuperGlobals中选择ID

时间:2014-03-28 22:40:22

标签: php mysql sql

基本上我正在构建一个CMS,这是一些与

有问题的代码
  

$v = $_GET['v'];
$con=mysqli_connect("*******","****","****","********");

// Check connection
if (mysqli_connect_errno())
  {
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM videos WHERE `v` = '$v'");

while($row = mysqli_fetch_array($result))
  {
   $title = $row['title'];
   $description = $row['description'];
   $views = $row['viewcount'];
   $video_src = $row['src'];
   $type = $row['embed_type'];
   if($type = "YouTube"){
   $yt_id = $row['yt_id'];
   }
  }
?>

这不会返回任何值!

0 个答案:

没有答案