deesse Posted August 15, 2007 Share Posted August 15, 2007 Hi All, I am a newbie in php...plzzzzzzzzzzz your help is needed. I have 5 different php codes. How can I combine/link all into one php command to execute ? The scripts help to connect to the MySQL database and download the contents through the URL. It goes like this: IF I have: - A.php to configure - B.php to create tables - C.php to clean data - D.php to command - E.php to start I would like to create a very simple interface where the user can only click on a single button (for instance DOWNLOAD.php) so that all the command can be executed at once? Instead of the user going through every single php script to modify the contents. How to proceed with this ? any sample example out there to illustrate this? hope to get your comments soon... thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/65066-php-scripts-in-1/ Share on other sites More sharing options...
frost Posted August 15, 2007 Share Posted August 15, 2007 You could have them all in seperate pages: <? include 'pageA.php'; include 'pageB.php'; include 'pageC.php'; include 'pageD.php'; include 'pageE.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/65066-php-scripts-in-1/#findComment-324793 Share on other sites More sharing options...
deesse Posted August 16, 2007 Author Share Posted August 16, 2007 thanks for the reply.... I am trying to include some of the scripts, hopefully it works. By the way, is there any php scripts example there that help like once one is connected to database (MySQL), it can prompt user to enter the database name and get feedback that the name has been created? And also connect directly to a URL through a command procedure? please help... thanks thanks... Quote Link to comment https://forums.phpfreaks.com/topic/65066-php-scripts-in-1/#findComment-325753 Share on other sites More sharing options...
deesse Posted August 18, 2007 Author Share Posted August 18, 2007 Hi All, I have this php script running fine but when it comes to creating tables it only creates the first table instead of 4.... why? am I missing something here???? help is appreciated.-.-.-.- <?php $link = mysql_connect('localhost', 'username', 'password'); if (!$link) { die('Could not connect: ' . mysql_error()); } $sql = 'CREATE DATABASE test2'; if (mysql_query($sql, $link)) { echo "Database test2 created successfully\n"; } else { echo 'Error creating database: ' . mysql_error() . "\n"; } // Create tables in test2 database mysql_select_db("test2", $link); $sql = "CREATE TABLE car ( title varchar(255) NOT NULL, description varchar(255) NOT NULL, priority tinyint(2) NOT NULL default '0' ) TYPE=InnoDB\n"; mysql_query($sql, $link); if (mysql_error()) echo __line__.") Error creating table: ".mysql_error(); //Create links table $sql = "CREATE TABLE links ( type varchar(20) NOT NULL default '', resource varchar(255) NOT NULL, ) TYPE=InnoDB\n"; mysql_query($sql, $link); if (mysql_error()) echo __line__.") Error creating table: ".mysql_error(); //Create home table $sql = "CREATE TABLE home ( name varchar(255) NOT NULL, title varchar(255) NOT NULL default '', description varchar(255) NOT NULL default '', ) TYPE=InnoDB\n"; mysql_query($sql, $link); if (mysql_error()) echo __line__.") Error creating table: ".mysql_error(); //Create people table $sql = "CREATE TABLE people ( name varchar(20) NOT NULL default '', address varchar(255) NOT NULL resource varchar(255) NOT NULL, ) TYPE=InnoDB\n"; echo "car,home,links, & people tables in the relational database (".test2.") have been successfully created!\n"; mysql_query($sql, $link); if (mysql_error()) echo __line__.") Error creating table: ".mysql_error(); mysql_close($link);//Close connection ?> Quote Link to comment https://forums.phpfreaks.com/topic/65066-php-scripts-in-1/#findComment-327632 Share on other sites More sharing options...
frost Posted August 20, 2007 Share Posted August 20, 2007 Are you getting any kind of error? Quote Link to comment https://forums.phpfreaks.com/topic/65066-php-scripts-in-1/#findComment-328893 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.