[Resolved] PHP making tables in Mysql..not working

SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Namecheap AuctionsNamecheap Auctions
Watch
Impact
19
PHP making tables in mysql..not working

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";
?>
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
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Just curious... why is the password field VARCHAR(10)?
 
0
•••
din't know what to use :p
is it bad?
 
0
•••
A maximum password length of 10 characters? I'd say that's not good. You can't exactly fit a good hash in there, either.

I'd suggest taking that out to at least 72 or 256 to be safe. Password security is worth it.
 
0
•••
Olitt — high-converting AI websites, only from $1/moOlitt — high-converting AI websites, only from $1/mo

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
URLs.com
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back