NameSilo

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

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
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
Close
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
Close
din't know what to use :p
is it bad?
 
0
Close
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
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

A browser tab with a favicon next to the page title
Search members
You can now search for members by name, company, location and more. Open the search at the top of any page and choose Members. You will...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back