note 29307 modified in ref.mysql by jsheets

From: Date: Sun, 09 Feb 2003 15:41:45 +0000
Subject: note 29307 modified in ref.mysql by jsheets
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43686@lists.php.net to get a copy of this message
[Editor's Note: it is possible to use multi-dimensional arrays in SQL queries (they are just a double quoted string) by using SELECT * FROM {$whichtable[$whichdb[$which]]} WHERE id = $entry"; ] I found out that you cannot use multidimensional arrays in a SQL-query, e.g. : $sql = "SELECT * FROM $whichtable[$whichdb[$which]] WHERE id = $entry"; this will work fine however : $tempvar = $whichtable[$whichdb[$which]]; $sql = "SELECT * FROM $tempvar WHERE id = $entry"; If it already is a bug, is it in mySQL or PHP ? --was-- I found out that you cannot use multidimensional arrays in a SQL-query, e.g. : $sql = "SELECT * FROM $whichtable[$whichdb[$which]] WHERE id = $entry"; this will work fine however : $tempvar = $whichtable[$whichdb[$which]]; $sql = "SELECT * FROM $tempvar WHERE id = $entry"; If it already is a bug, is it in mySQL or PHP ? http://www.php.net/manual/en/ref.mysql.php

« previous php.notes (#43686) next »