2016-10-25 31 views
0

function.php我不能讓調用ID形成fuctions頁它顯示錯誤

<a href = "details.php?pro_id='.$pro_id.'"><button type="button" class="btn btn-primary">View Detail</button> </a> 

====================== =====================

details.php

if(isset($_GET(['pro_id'])){ 

$product_id = $_GET['pro_id']; 
$get_pro = "select * from products where product_id='$product_id'"; 

$run_pro = mysqli_query($con, $get_pro); 

它不工作它會顯示以下錯誤:

Fatal error: Cannot use isset() on the result of a function call (you can use "null !== func()" instead) in C:\xampp\htdocs\Raj_Cassette\details.php on line 52

+0

isset()函數的功能是用於測試VARS。 http://php.net/manual/en/function.isset.php –

+0

刪除()。 $ _GET是數組,因此您需要編寫$ _GET ['pro_id'],而不使用大括號 – RJParikh

+0

@JethroHazelhurst請.... htmlspecialchars不是用於轉義查詢的值:/ – nospor

回答

5

$ _GET不是函數。它是一個數組所以

$_GET(['pro_id'])

但是

$_GET['pro_id']

+0

oops!菜鳥的錯誤。謝謝 。 –