Date: 04/25/06 (PHP Community) Keywords: php, mysql, sql Solved:see bottom of post for more info. echo "Creating tables and data for $sql_file_name..."; $str = file_get_contents($filePath . $sql_file_name); if (mysql_query($str)) { echo " Done.The runtime came back with 1064: Error on querry for sqlfile address.sql:My guess is that since PHP queries are submitted without a semi-colon that this tripped up the system. So my question: Is there a php command: Run_sql_in_file($filepath) ... or Is there a way to split my .sql string that I'm getting from file_get_contents() into an array split by the semicolon character? If not obvious I am quite new to PHP and pretty much self teaching as I go. Thanks! SOLVED: I found the explode() command. zimzat posted at about the same time. I'm on the way out, but will post the final function I generated later if people are interested.
|