OtagoHarbour Posted April 16, 2011 Share Posted April 16, 2011 I'm running MySQL under PHP. I use the following to delete a table called SubScribers. mysql_select_db("DraculaDB", $con); DROP TABLE SubScribers;For some reason, the latter line results in the following error message.Parse error: syntax error, unexpected T_STRING Link to comment Share on other sites More sharing options...
Synook Posted April 16, 2011 Share Posted April 16, 2011 Using MySQL in PHP is not like using embedded SQL - you need to enclose your query in a mysql_query() call. It also needs to be a string. Link to comment Share on other sites More sharing options...
OtagoHarbour Posted April 16, 2011 Author Share Posted April 16, 2011 Using MySQL in PHP is not like using embedded SQL - you need to enclose your query in a mysql_query() call. It also needs to be a string.I changed the call tomysql_query("DROP TABLE SubScribers");and it appears to work.Thanks very much,Peter. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.