sridhar golyandla Posted March 21, 2009 Share Posted March 21, 2009 Hi to all, please any one can help me out... "how can insert new table into phpmyadmin using php". Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/ Share on other sites More sharing options...
Maq Posted March 21, 2009 Share Posted March 21, 2009 What do you mean "Insert new table into mysql, phpmyadmin, using PHP"? Have you even tried Googling this? Create table. Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790139 Share on other sites More sharing options...
sridhar golyandla Posted March 21, 2009 Author Share Posted March 21, 2009 Maq, i want to store a new table from local system into phpmyadmin through php code? Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790140 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 look at this example i made yesterday. <?php $connect_database=mysql_connect("localhost","username","password") or die("Databse connection problam".mysql_error()); $sql="CREATE DATABASE website_links"; $res=mysql_query($sql)or die(mysql_error()); $sql2="USE website_links"; $res2=mysql_query($sql2)or die(mysql_error()); $sql3="CREATE TABLE link_stats( stat_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, car_stats INT DEFAULT '0' NOT NULL, van_stats INT DEFAULT '0' NOT NULL, truck_stats INT DEFAULT '0' NOT NULL )"; $res3=mysql_query($sql3)or die(mysql_error()); $sql4="INSERT INTO link_stats(car_stats,van_stats,truck_stats) VALUES('1','1','1')"; $res5=mysql_query($sql4)or die(mysql_error()); if($res5){ echo" DATABASE CREATED THANK YOU!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790154 Share on other sites More sharing options...
Maq Posted March 21, 2009 Share Posted March 21, 2009 Maq, i want to store a new table from local system into phpmyadmin through php code? Sure just do a mysqldump (you can specify a single table). Then, if you have ssh access, you can run this in the command prompt: mysql If you don't have ssh access let me know, there's another solution. Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790158 Share on other sites More sharing options...
sridhar golyandla Posted March 21, 2009 Author Share Posted March 21, 2009 i want to import the new table which is saved file in the ".SQL" format in local system to phpmyadmin through php code. Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790159 Share on other sites More sharing options...
redarrow Posted March 21, 2009 Share Posted March 21, 2009 will help. If you know how to do it with a commandline what's wrong with exec("mysql < test.sql"); ? http://www.ozerov.de/bigdump.php http://drupal.org/node/43024 <?php // Database configuration $db_server = "localhost"; $db_name = "your_DB_name"; $db_username = "your_DB_user_name"; $db_password = "your_DB_password"; // Other Settings // Specify the dump filename to suppress the file selection dialog $filename = "the_file_you_wish_to_execute"; // Lines to be executed per one import session $linespersession = 3000; // You can specify a sleep time in milliseconds after each session // Works only if JavaScript is activated. Use to reduce server overrun $delaypersession = 0; ?> Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790168 Share on other sites More sharing options...
revraz Posted March 21, 2009 Share Posted March 21, 2009 PHPMYADMIN is just a tool to help you access you MySQL DB, nothing more. Matter of fact, PHPMYADMIN is PHP itself. So your question makes no sense. I Quote Link to comment https://forums.phpfreaks.com/topic/150442-insert-new-table-into-mysql-phpmyadmin-using-php/#findComment-790276 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.