new day, and already a new problem (i'm really posting to much questions :-O ) like specified in an earlier question, i'm using an access database in my website. to get it i'm using a DOM-object in php (see code below). this works fine as long as the database doesn't contain tables with spaces in their names.
my problem is that my users should be able to select any access database. not only those without spaces.
Expand|Select|Wrap|Line Numbers
- $db = $_GET["db"];
- $path = str_replace("/", "\\", $_SERVER["DOCUMENT_ROOT"] . "/" . $db);
- $db_connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=".$path.";Persist Security Info=False;";
- $db_connection = new COM("ADODB.Connection", NULL, 1251);
- $db_connection->open($db_connstr);
- $query = "SELECT * FROM 2009 4 24";
- $rs = $db_connection->execute($query); //SQL error here
EDIT: srr for this. i found what i had to do 3 minutes after i posted this(after 4 hours search). srr for this.
for those with the same problem: use brackets [] instead of single or double quotes