Advertisement
Squito

Tábla generálás

Jan 9th, 2018
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php
  2. $text="ho1 text DEFAULT NULL, ho2 text DEFAULT NULL, ho3 text DEFAULT NULL, ho4 text DEFAULT NULL, ho5 text DEFAULT NULL, ho6 text DEFAULT NULL, ho7 text DEFAULT NULL, ho8 text DEFAULT NULL, ho9 text DEFAULT NULL, ho10 text DEFAULT NULL, ho11 text DEFAULT NULL, ho12 text DEFAULT NULL, ho13 text DEFAULT NULL, ho14 text DEFAULT NULL";
  3. $a=array($text, str_replace("ho", "szel", $text), str_replace("ho", "egkep", $text));
  4. echo "CREATE TABLE megfigyeles (id int(11) NOT NULL, datum date NOT NULL, ".implode(", ", $a).")"; //stb...
  5. ?>
  6. <br>ALTER TABLE megfigyeles ADD PRIMARY KEY (`id`);
  7. <br>ALTER TABLE megfigyeles MODIFY id int(11) NOT NULL AUTO_INCREMENT;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement