Hier kann eine Notiz zum Merk-Eintrag hinzugefügt werden (optional)
Geschlossen |
1 2 3 4 | $qry = mysql_query( "SHOW TABLES LIKE 'name'" ); if (mysql_num_rows( $qry )) { //tabelle existiert } |
1 2 3 4 5 6 7 8 9 10 11 12 | $check_css = db_query("SHOW TABLES LIKE `prefix_tagcloudcss`"); if (mysql_num_rows($check_css == 0)) { #Tag-Cloud-Css Tabelle wird angelegt db_query("CREATE TABLE `prefix_tagcloudcss` ( `id` smallint (6) NOT NULL auto_increment, `css` varchar (500) NOT NULL default '', PRIMARY KEY (`id`) )"); } else { echo "existiert schon"; } |
1 2 3 4 5 6 7 8 9 10 11 12 | $check_css = mysql_query( "SHOW TABLES LIKE `prefix_tagcloudcss`" ); if (mysql_num_rows( $check_css ) == 0) { #Tag-Cloud-Css Tabelle wird angelegt db_query("CREATE TABLE `prefix_tagcloudcss` ( `id` smallint (6) NOT NULL auto_increment, `css` varchar (500) NOT NULL default '' , PRIMARY KEY (`id`) )"); } else { echo "existiert schon" ; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 | $check_css = mysql_query( "SHOW TABLES LIKE 'prefix_tagcloudcss'" ); if (mysql_num_rows( $check_css )) { echo "existiert schon" ; } else { echo "<br>Die Datenbanken werden angelegt<br>" ; #Tag-Cloud-Css Tabelle wird angelegt db_query("CREATE TABLE `prefix_tagcloudcss` ( `id` smallint (6) NOT NULL auto_increment, `css` varchar (500) NOT NULL default '' , PRIMARY KEY (`id`) )"); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | <?php define ( 'main' , TRUE ); error_reporting (E_ALL); #------------------------------------------------------------------------------------------------------------ #Copyright by: Felix Hohlwegler $support = "www.felix-hohlwegler.de" ; $mail = "felix.hohlwegler@gmx.de" ; $version = "0.3" ; $version_old = "0.2" ; $datum = "08.02.2013" ; #------------------------------------------------------------------------------------------------------------ #Includes require_once ( 'include/includes/config.php' ); require_once ( 'include/includes/func/db/mysql.php' ); #------------------------------------------------------------------------------------------------------------ #Datenbank Verbindung herstellen db_connect(); #------------------------------------------------------------------------------------------------------------ #Prüfen ob Tabellen vorhanden $check_css = db_query( "SHOW TABLES LIKE 'prefix_tagcloudcss'" ); $check_tag = db_query( "SHOW TABLES LIKE 'prefix_tagcloud'" ); $check_support = db_query( "SHOW TABLES LIKE 'prefix_tagcloudsupport'" ); #------------------------------------------------------------------------------------------------------------ #Tag-Cloud-Support Tabelle wird angelegt oder upgedatet if (db_num_rows( $check_support )) { echo "<p>Update Tag-Cloud Modul-Version und Modul-Datum</p>" ; db_query( 'UPDATE `prefix_tagcloudsupport` SET version = "' . $version . '", datum = "' . $datum . '" WHERE version = "' . $version_old . '"' ); } else { echo "<p>Tag-Cloud Support Informationen werden eingetragen</p>" ; db_query("CREATE TABLE `prefix_tagcloudsupport` ( `support` varchar(200) NOT NULL default '' , `mail` varchar(200) NOT NULL default '' , `version` varchar (100) NOT NULL default '' , `datum` varchar (100) NOT NULL default '' , PRIMARY KEY (`version`) )"); db_query( 'INSERT INTO `prefix_tagcloudsupport` (support, mail, version, datum) VALUES ( "' . $support . '", "' . $mail '", "' . $version '","' . $datum '") ' ); } #------------------------------------------------------------------------------------------------------------ #Tag-Cloud-Css Tabelle wird angelegt if (db_num_rows( $check_css )) { echo "<p>existiert schon</p>" ; } else { echo "<p>Die Datenbanken werden angelegt</p>" ; db_query("CREATE TABLE `prefix_tagcloudcss` ( `id` smallint (6) NOT NULL auto_increment, `css` varchar (500) NOT NULL default '' , PRIMARY KEY (`id`) )"); } #------------------------------------------------------------------------------------------------------------ #Tag-Cloud Tabelle wird angelegt + Modul Registrieren if (db_num_rows( $check_tag )) { echo "<p>existiert schon</p>" ; } else { db_query("CREATE TABLE `prefix_tagcloud` ( `id` smallint (6) NOT NULL auto_increment, `href` varchar(200) NOT NULL default '' , `name` varchar (100) NOT NULL default '' , `cssid` varchar (6) NOT NULL default '' , PRIMARY KEY (`id`), CONSTRAINT fk_RANK FOREIGN KEY (`cssid`) REFERENCES `prefix_tagcloudcss`(`id`) )"); echo "<p>Das Modul wird registriert</p>" ; #Modul wird bei Ilch Registriert db_query( "INSERT INTO `prefix_modules` VALUES ('', 'tagcloud', 'Tag-Cloud', 1, 1, 1) " ); } #------------------------------------------------------------------------------------------------------------ echo "<p>Die Tabellen wurden angelegt</p>" ; echo "<p>Die Installation is abgeschlossen</p>" ; ?> |
Geschlossen | ||
![]() |
Zurück zu HTML, PHP, SQL,... |