- Impact
- 19
PHP making tables in mysql..not working
hey why is this code not working?
it connects to the database and everything but gives me this :
Query was empty
NVM I FIGURED IT OUT LOL
I USED $SQL FOR THE QUERY, BUT WHEN I DID MYSQL_QUERY, i used $query
lol
hey why is this code not working?
PHP:
<?php
require_once("./config.php");
//Make a MYSQL Connection
mysql_connect($db_host,$db_user,$db_pass) or die(mysql_error());
mysql_select_db($db_name) or die (mysql_error());
$sql = 'CREATE TABLE `data` (`id` INT(20) NOT NULL, `site` VARCHAR(20) NOT NULL, `username` VARCHAR(10) NOT NULL, `password` VARCHAR(10) NOT NULL, `other` TEXT NOT NULL, `yes` VARCHAR(5) NOT NULL, `no` VARCHAR(5) NOT NULL, `ip` VARCHAR(12) NOT NULL, `show` INT(1) NOT NULL, `time` TIMESTAMP(5) NOT NULL DEFAULT CURRENT_TIMESTAMP, UNIQUE (`id`)) ENGINE = MyISAM';
$result=mysql_query($query) or die (mysql_error());
echo "All tables have been created, click next to finish the set up";
?>
Query was empty
NVM I FIGURED IT OUT LOL
I USED $SQL FOR THE QUERY, BUT WHEN I DID MYSQL_QUERY, i used $query
lol
Last edited: