Zoom Posted August 29, 2005 Report Share Posted August 29, 2005 (edited) Varbut kads man varetu kadu mazu minimalu paraudzinu paradit ka var ar PHP skripta palidzibu izveidot jaunu datu bazi ? Es domaju ieraksta lauka DB nosaukumu un spiez pogu "izveidot". Edited August 29, 2005 by Zoom Link to comment Share on other sites More sharing options...
Delfins Posted August 29, 2005 Report Share Posted August 29, 2005 blin, manuāli lasīt māki? $dbname = $_POST['dbname']; $sql = "create database `{$dbname}`"; Link to comment Share on other sites More sharing options...
Zoom Posted August 29, 2005 Author Report Share Posted August 29, 2005 thx Link to comment Share on other sites More sharing options...
Robis Posted August 29, 2005 Report Share Posted August 29, 2005 Vienīgais, ka nevienmēr php skriptam ļaus izveidot db (piemēram, ja klientam, kurš lieto skriptu, ir pieejama tikai vien, jau izviedota db). Link to comment Share on other sites More sharing options...
Zoom Posted August 29, 2005 Author Report Share Posted August 29, 2005 Kautka ta ? <?php $data = @mysql_connect('localhost', 'einars', '') or die ('sudi nu ir :('); if(isset($_POST['sutit'])){ $dbname = $_POST['dbname']; $sql = "create database `{$dbname}`"; } ?> <form method="post" action=""> <input type="text" name="dbname"><br> <input type="submit" name="sutit" value="Sutit"> </form> Bet man vins neizveido.. :( Link to comment Share on other sites More sharing options...
Robis Posted August 29, 2005 Report Share Posted August 29, 2005 Nu, raksti: <?php $data = @mysql_connect('localhost', 'einars', '') or die ('sudi nu ir :('); if(isset($_POST['sutit'])){ $dbname = $_POST['dbname']; $sql = "CREATE DATABASE `".$dbname."`"; } ?> <form method="post" action=""> <input type="text" name="dbname"><br> <input type="submit" name="sutit" value="Sutit"> </form> Ja neizveido, pārbaudi vispār, vai tev ir tiesības to izveidot. Link to comment Share on other sites More sharing options...
Zoom Posted August 29, 2005 Author Report Share Posted August 29, 2005 man aizgaja sadi: <?php if(isset($_POST['sutit'])){ $dbname = $_POST['dbname']; $sql = "create database `{$dbname}`"; } mysql_query($sql) or die(mysql_error()); ?> <form method="post" action=""> <input type="text" name="dbname"><br> <input type="submit" name="sutit" value="Sutit"> </form> Link to comment Share on other sites More sharing options...
Robis Posted August 29, 2005 Report Share Posted August 29, 2005 Ā, nu pareizi Zoom - reku attapīgs, pats atrada kļūdu :) Paldies, pārbaudi izturēji, sēdies, 4+ Link to comment Share on other sites More sharing options...
Zoom Posted August 29, 2005 Author Report Share Posted August 29, 2005 (edited) tas ir 10 ballu sitema ? :angry: :D Un vel netaisot jaunu topiku. Kura manueli var atrast (PHP vai MySQL) paraudzinu ka var tabulas ievietot tada pasa veida. Tabulas jau sarakstitas php skripta. Tik skriptam ir jaieliek vinas DB.. Edited August 29, 2005 by Zoom Link to comment Share on other sites More sharing options...
Robis Posted August 29, 2005 Report Share Posted August 29, 2005 http://lv.php.net - php manualis http://dev.mysql.com/doc/mysql/en/index.html - MySQL manualis Link to comment Share on other sites More sharing options...
Zoom Posted August 29, 2005 Author Report Share Posted August 29, 2005 (edited) to jau pats vereju samklet. es domaju atslegvards. insert table ? Edited August 29, 2005 by Zoom Link to comment Share on other sites More sharing options...
Robis Posted August 29, 2005 Report Share Posted August 29, 2005 CREATE TABLE http://dev.mysql.com/doc/mysql/en/create-table.html Link to comment Share on other sites More sharing options...
Delfins Posted August 29, 2005 Report Share Posted August 29, 2005 to jau pats vereju samklet. es domaju atslegvards. insert table ? 21610[/snapback] tu search vispār māki izmantot? Link to comment Share on other sites More sharing options...
Recommended Posts