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? Link to comment https://forums.phpfreaks.com/topic/46361-solved-a-little-help-needed/ Share on other sites More sharing options...
Jumba Posted April 10, 2007 Author Share Posted April 10, 2007 I got it! Link to comment https://forums.phpfreaks.com/topic/46361-solved-a-little-help-needed/#findComment-225992 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.