Dynadot โ€” .com Registration $8.99

MySQL help

Spaceship Spaceship
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
•••
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
•••
thanks alot :)
 
0
•••
Dynadot โ€” .com Registration $8.99Dynadot โ€” .com Registration $8.99
Appraise.net
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back