Results 1 to 9 of 9
Oct 20, 2000, 17:19 #1
- Join Date
- Jun 2000
- Slovenia, Europe
- 0 Post(s)
- 0 Thread(s)
I have a table of categories, which has 2 columns, ID and Title.
Using this statement I combine these two columns in one variable:
$cat = $row['ID']. " " .$row['Title'];
Then I send it through query string:
echo("<TR><TD width=\"5%\"><center><font face=\"Arial\" size=2><a href='$PHP_SELF?delcat=$catid&catde=$cat'>".$row['ID']."</a></font></center></TD>");
This is where I use it then:
$delete_authors = "DELETE FROM authors WHERE category=$catde";
My Category column in authors table is also combined of ID and Title(for example: 5 City News), so there shouldn't be any problem.
But this is what I get as a result(lets say $catde=5 City News):
You have an error in your SQL syntax near 'City News' at line 1
This is really bugging me. I think there's something wrong in passing this text through query string(this is how it looks in query string: catde=5%20City%20News). Is this ok?
Thanks in advance