PDA

View Full Version : How is my code....



Hartmann
Wed 19th Jul '00, 7:47pm
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?

Mike Sullivan
Wed 19th Jul '00, 8:05pm
These are just my coding prefs:

<?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]