2014-05-05 41 views
-1

動態頁面我怎樣才能改變URL多個環節

http://server.com/windows/antivirus-software.php?**SoftID=1**

http://server.com/Accuretasoft.com/windows/antivirus-software.php?**name=some_text**

當我改變SoftID的從整數 我使用的文本它迴應的錯誤:

<?php 
$dbh=mysql_connect("xyz","userxyz","password"); 
mysql_select_db("somedb"); 
$SoftID = $_GET['SoftID']; 
$row_sql="SELECT * From table Where SoftID=$SoftID"; 
$row_query = mysql_query($row_sql); 
$rowSoft = mysql_fetch_assoc($row_query); 
?> 

回答

0

當您在查詢中使用字符串時,您必須將它們用引號括起來,如

$row_sql="SELECT * From table Where SoftID='$SoftID'";