Announcement

Collapse
No announcement yet.

How is my code....

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How is my code....

    All I am doing is creating a simple database with two tables.

    <?
    $databaseName = "Forum";
    $userName = "Username";
    $password = "Pass";
    $hostName = "www.whatever.com";

    $action = QUERY_STRING;

    if($action == 'first_time')
    {
    mysql_create_db($databaseName);
    $create_table = "CREATE TABLE Name (field VARCHAR (34) not null )";
    $create_table2 = "CREATE TABLE Password (field VARCHAR (34) not null)";

    $result = MYSQL_QUERY($create_table);
    }
    else {
    echo ("Whatever I want lol!");

    }

    So does it look alright?


  • #2
    These are just my coding prefs:
    Code:
    <?php 
    
    $databaseName = "Forum"; 
    $userName = "Username"; 
    $password = "Pass"; 
    $hostName = "localhost"; 
    
    if ($action=="first_time") { 
    
    mysql_create_db($databaseName); 
    $create_table = "CREATE TABLE Name (field VARCHAR (34) not null )"; 
    $create_table2 = "CREATE TABLE Password (field VARCHAR (34) not null)";
    
    $result1 = mysql_query("$create_table");
    $result2 = mysql_query("$create_table2");
    
    } #end action=="first_time"
    else { 
    echo ("Whatever I want lol!"); 
    
    } #end else
    
    ?>
    [Edited by Ed Sullivan on 07-19-2000 at 07:06 PM]

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X