Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

MySQL help

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

def1

Established Member
Impact
6
I need to set up one database with 2 tables

heres what I go so far

Code:
CREATE TABLE bands (
uband varchar(20) NOT NULL default '',
umembers longtext NOT NULL,
ubio longtext NOT NULL,
unews longtext NOT NULL,
time varchar(50) NOT NULL default '',
id int(11) NOT NULL auto_increment,
PRIMARY KEY (id)
) TYPE=MyISAM;

Code:
CREATE TABLE mpThree (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
type VARCHAR(30) NOT NULL,
size INT NOT NULL,
content MEDIUMBLOB NOT NULL,
PRIMARY KEY(id)
);

For the first table I want to add more like City, State, Country, Zip Code, Genre 1, Genre 2, Genre 3 but I want them to have drop down menus and I dont know how to do that with mysql. Im really confused can someone shed some light on me how to do this. Also with the mp3 table ready will I be able to extract audio files from the table and use them in a flash player?

Any help will be useful thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
If you want to make a new column in a table:

Code:
alter table bands add whatever_column definition goes here;

If you want to make a drop-down menu ordered by city (in ascending order):
PHP:
<?php
$sql = "select unique(city) from bands order by city asc";
$exe = mysql_query($sql);

if (mysql_num_rows($exe) < 1) {
echo "No cities found."
} else {
while ($array = mysql_fetch_array($exe)) {
$dropdown .= "<option value=\"".$array["city"]."\">".$array["city"]."</option>";
}
}
?>

Basically that's it. Just echo $dropdown (remember to add: the <input> elements to it, and after the while (closing tag) so that you have a full dropdown)
 
0
Close
thanks alot :)
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back