|
Posted by Carramba on 06/14/05 17:09
On Tue, 14 Jun 2005 07:53:15 +0200, Steve <ThisOne@Aint.Valid> wrote:
> On Mon, 13 Jun 2005 20:55:08 +0200, Carramba wrote:
>
>> hi!
>>
>> I have simple form like
>> <form method="POST" action="create_db.php"> db name: <input type="text"
>> name="db" size="20"> <br>
>> table name: <input type="text" name="table" size="20"> <br>
>> Skriv in field name: <input type="text" name="name" size="20"> <input
>> type="submit" value="Submit"><input type="reset">
>>
>>
>> I want to pass thouse variable to create_db.php but having problems..
>> how
>> to do it?
>>
>> <?
>> //create_db.php
>> $create ="CREATE DATABASE " + $db;
>>
>> $link = mysql_connect(localhost,root);
>>
>> if (! $link)
>> die("Couldn't connect to MySQL");
>> mysql_query( $create );
>> if ( $link ){ //om länk finns skapa tabel
>> mysql_select_db( $db, $link)
>> or die("Select DB Error: ".mysql_error()); mysql_query("CREATE TABLE
>> $table( id INT NOT NULL AUTO_INCREMENT,
>> PRIMARY KEY(id), namn VARCHAR(30) )") or die("Create table Error:
>> ".mysql_error());
>> //sätter in värden från formen in i tabelen mysql_query ("INSERT INTO
>> personer ( name ) VALUES ('$name')");
>> }
>> else {
>> echo "succes";
>> mysql_close($link);
>> }
>> ?>
>
> Fixinf the logic in your php would help as well (:
what do you mean
p.s. proglem is solvt
--
Thanx in advance
________________________
BTW. I know my english is not best in the word, so please stop bugging me
about my spelling. And yes Iam sorry you don't understand what I mean, but
there is no point to yell at me. Have a nice day.
Navigation:
[Reply to this message]
|