wappy 0 Report post Posted July 7, 2006 Can anyone show me example code of how to install a database table instead of me having to upload an file with it in, so i can do it from a php page? Thanks in advance ;-) Share this post Link to post Share on other sites
nehmanator333 0 Report post Posted July 8, 2006 google.com Share this post Link to post Share on other sites
wappy 0 Report post Posted July 11, 2006 But i don't want to search google? I use this site and post my code snippets here, also i know for a fact someone here can help me with this.. What is the use in searching google when we can build a nice database of code and php help here? If i find the code before anyone replys with it i will post it here anyhow as it may be usefull to other users here. Share this post Link to post Share on other sites
farsiscript 0 Report post Posted July 11, 2006 HiIf You want Make install.php for your Script do this :at first make config.php file with this codes : <?php mysql_connect("localhost","Database Username","Database Password") or die(mysql_error()); mysql_select_db("Database Name") or die(mysql_error());?>and then For Create tables in your database paste this code in install.php file :include ("config.php"); mysql_query("CREATE TABLE news (id tinyint(4) NOT NULL auto_increment,text text NOT NULL,sub text NOT NULL,PRIMARY KEY (id)) TYPE=MyISAM; "); With this code You create news tables in your DatabaseTables news has 2 column ( Text and sub) if you want make more column look at this query :include ("config.php"); mysql_query("CREATE TABLE news (id tinyint(4) NOT NULL auto_increment,text text NOT NULL,sub text NOT NULL,time text NOT NULL,PRIMARY KEY (id)) TYPE=MyISAM; ");at this query we add new column (time) to tabelat end save install.php file and when you browse install.php in your browser your databse and tables are creat Share this post Link to post Share on other sites
wappy 0 Report post Posted July 17, 2006 thanks alot, that is exactly what i was looking for :-) i can finish my script now, thanks again :-) Share this post Link to post Share on other sites
electron 0 Report post Posted July 18, 2006 What script are you making may i know. Share this post Link to post Share on other sites