Jumba Posted April 10, 2007 Share Posted April 10, 2007 Hi Guys I need some help with this script. This one is working perfectly.. <?php // Open Connection To mySQL. // Replace 'username' and 'password' with appropiate login values for your server. $mysqlLink = mysql_connect( 'localhost' , 'username' , 'password' ); // Select mySQL Database. mysql_select_db( 'database_name' , $mysqlLink ); // Create Query To Create Table. $sql = 'INSERT INTO `table0` (`ID`, `Name`, `Age`) VALUES (NULL, \'Mike\', \'19\');'; // Issue Query. mysql_query( $sql ); // Close mySQL Connection. mysql_close( $mysqlLink ); ?> But I actually was wondering, instead of having to write the info in this code ('INSERT INTO `table0` (`ID`, `Name`, `Age`) VALUES (NULL, \'Mike\', \'19\');' Isn't there a way to tell php to go to say "data.sql" and execte the queries in that file? and if it's possible, how do I do it? Quote Link to comment Share on other sites More sharing options...
Jumba Posted April 10, 2007 Author Share Posted April 10, 2007 I got it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.