多个链接的动态页面

时间:2014-05-05 09:45:57

标签: php

如何更改网址

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); 
?>

1 个答案:

答案 0 :(得分:0)

在查询中使用字符串时,必须将它们用引号括起来,如

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