Jump to content

Would This Work?


calumrouge

Recommended Posts

My Hosting is down. Could someone please tell me if the following will work:

[font=Courier New][b]<?php
$conn = mysql_connect("localhost","missionxgame_admin","PRIVATE");
if (!$conn)
  {
  die('Could not connect: ' . mysql_error());
  }
 
  if (mysql_query("CREATE DATABASE missionxgame_gamedb",$conn))
  {
  echo "Database created";
  }
else
  {
  echo "Error creating database: " . mysql_error();
  }
 
  mysql_select_db("missionxgame_gamedb", $conn);
$sql = "CREATE TABLE Users
(
Person-ID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY(personID),
Username varchar(15),
Password varchar(20),
E-mail varchar(100),
)";
mysql_query($sql,$conn);

mysql_select_db("missionxgame_gamedb", $conn);
mysql_query("INSERT INTO Users (Username,Password,E-mail)
VALUES ('Admin', 'PRIVATE', '[email protected]')");
?>[/b][/font]
Link to comment
https://forums.phpfreaks.com/topic/29385-would-this-work/
Share on other sites

[quote author=calumrouge link=topic=117284.msg478358#msg478358 date=1165233959]
My Hosting is down. Could someone please tell me if the following will work[/quote]

You should download XAMPP or some other local development environment. It will make your life much easier.
Link to comment
https://forums.phpfreaks.com/topic/29385-would-this-work/#findComment-134930
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.