I Have two files one containing the user information for the MySql etc (File 1),
and one trying to create tables using that information (File 2).
File 1:
- Code: Select all
<?php
$mysqlhost = 'localhost';
$mysqlname = 'dbname';
$mysqluser = 'user';
$mysqlpass = 'mypasswd';
$conn = mysql_connect('localhost', 'user', '') or die ('Cant Conect to MySQL server');
$db = mysql_select_db('dbname', $conn) or die ('Cant Select Database');
?>
File 2 :
- Code: Select all
<?php
include('../other/info.php');
mysql_query("CREATE TABLE customer
(name VARCHAR(15), post VARCHAR(255))");
?>
When I run the above, the tables are not created and I'm just given a blank page.
According to books I have, and many websites I've been to, this should be working.
Whats wrong?