Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Query problem again

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
NamecheapNamecheap
Watch
Impact
19
Hey
Whats wrong wid this code now
PHP:
@mysql_select_db($database) or die( "Unable to select database");
$query= 'INSERT INTO `user` (`id`, `username`, `pass`, `email`, `lastlogin`, `health`, `country`, `level`, `armysize`) VALUES (NULL, $username, $pass, $email, NULL, \'100\', $country, \'1\', \'1\');';
mysql_query($query);

its not giving any error but instead of adding whats in $username its adding the "$username" into the database..
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Change it too this.

PHP:
 @mysql_select_db($database) or die( "Unable to select database");
$query= "INSERT INTO user ('username', 'pass', 'email', 'lastlogin', 'health','country', 'level', 'armysize') VALUES ($username, $pass, $email, NULL, \'100\', $country, \'1\', \'1\')";
mysql_query($query);

All use " (double quotes) while setting the mysql query. Also ` are extremely slow. So use ' insted.

" = text & variables
' = text (variables are thought of as text)

- Steve
 
0
•••
$query= "INSERT INTO `user` (`id`, `username`, `pass`, `email`, `lastlogin`, `health`, `country`, `level`, `armysize`) VALUES (NULL, $username, $pass, $email, NULL, \'100\', $country, \'1\', \'1\')";

That should do it...I think.
 
0
•••
PHP:
@mysql_select_db($database) or die("Unable to select database"); 
$query= "INSERT INTO user(id, username, pass, email, lastlogin, health, country, level, armysize) VALUES (NULL, '$username', '$pass', '$email', NULL, 100, '$country', 1, 1)";
mysql_query($query);

That'll do it.
 
0
•••
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

Parking: find your domains by pasting a list
You can now paste a list of domain names into the search box at the top of the Parking menu. Put one name on each line. Your domain list...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back