Hi
Problem:
http://localhost/www.website.com/new.php?id="180"
returns error as follows:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"180\"' at line 1
This works!:
http://localhost/www.website.com/new.php?id=180
Thing is i dont know ho to chnage my code to get rid of the double quotes!
On iis :http://localhost/www.website.com/new.php?id="180"
works fine, but on apache it doesnt!
whay is this?
What shall i do?
index.php:
print "id\">$row->title";
new.php:
include("db/db_config.php");
{
$id = $_GET["id"];
$sql = "SELECT * FROM articles WHERE id = $id";
}
// $sql = "SELECT id,datetime,title,author,body,author_box FROM t4d.articles WHERE id = $_GET["id"] LIMIT 1";
$rs = mysql_query($sql) or die(mysql_error());
Thanks in advance
Tovia Singer
2007-12-10
03:53:31
·
5 answers
·
asked by
jam
5
in
Computers & Internet
➔ Programming & Design