Hi, I'm trying to make a 2 line query. For example:
Query I want to perform:
CREATE TABLE temp (id INT(11) NOT NULL AUTO_INCREMENT, music INT(11) NOT NULL, PRIMARY KEY(id));
INSERT INTO temp (music) SELECT music FROM existing
Above query on a php file:
$query = "CREATE TABLE temp (id INT(11) NOT NULL AUTO_INCREMENT, music INT(11) NOT NULL, PRIMARY KEY(id));";
$query .= "INSERT INTO temp (music) SELECT music FROM existing";
Above query on a php file, in another method (which gave me an error):
$query = "CREATE TABLE temp (id INT(11) NOT NULL AUTO_INCREMENT, music INT(11) NOT NULL, PRIMARY KEY(id));\r\n";
$query .= "INSERT INTO temp (music) SELECT music FROM existing";
Now if I copy & paste the original query that I want to perform, in like Phpmyadmin's sql field, it works fine. However, if I try to run this same query using a php file, it just won't work, as the query concatenation makes the 2 line query into a 1 line query. I have tried using <br>, \n, \r\n, and none of these work, they all give out sql error messages. This means the normal ways of adding a new line does not work here. I'm completely out of ideas. Any ideas? Thanx for any help in advance!