Jump to content

Create Tables in Mysql


superhoops

Recommended Posts

Hi my name is Michael and i have just started working with mysql today. I have a database already and want to  add a table to it using sql/php code.

Here is the code i have:

<?php
$con = mysql_connect

("db5.awardspace.com:3306","fmpsite_reg","password");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
// Create table in fmpsite_reg database
mysql_select_db("fmpsite_reg", $con);
$sql = "CREATE TABLE Market
(
Player varchar(15),
Price varchar(12),
Type text
Position text
Age int(2)
Ka int(2)
Ta int(2)
Pa int(2)
Sa int(2)
)";
mysql_query($sql,$con);
?>

I have put in the password field password so noone here takes it but i was wondering what is wrong with the code or what i need to do to create the tables as i uploaded this file and went to my database and the table had not been created.

Any help will be greatly appreciated.

Thanks
Michael
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.