0

I would like to know how to a use a text box in winform to name the table .
can anybody help me please

I am using the following statement to create table

SQL = "CREATE TABLE tbCatalogue ([Id] COUNTER, [Stock Code] TEXT(10), [Account Number] TEXT(6))"

4
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by Josef01
0

As i presumes you want to create table using any of the field like textbox or combobox....
Just understand this code that how it works and your problem will be solved-

<form method="POST">
Enter table name<input type="text" name="t_name">
<input type="submit" value="submit" name="submit">
</form>
<?php
if(isset($_POST['t_name']))
{
//database connection string
SQL = "CREATE TABLE ".$_POST['t_name']."([Id] COUNTER, [Stock Code] TEXT(10), [Account Number] TEXT(6))"
}
?>

Hopefully it is clear...If you have any doubt you can post it ...
PS-IF your problem is solved mark the thread as solved...

0

Just understand this code that how it works and your problem will be solved-

Of course you will have to check first if the table already exists, maybe include a DROP TABLE statement, sanitize the input so that no malicious user can compromise or erase your whole database, and set the character sets and collating sequences according to your needs.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.