davaddavad
Programmer
How do i add the show table command to this script? I hope it is ok to show this script if not mod delete it please. I just got php installed by my host and mysql. I dont have phpmyadmin or a mysql window. The only way I can connect is thru php. My host gave me the first half of the php page below. I added the select and create table from another script i found. I believe it built the table but I havent found the correct script to show the table to me. any help appreciated Dave
<?
$host="**********";
$dbase="********";
$login="********";
$passwd="********";
$cnx = mysql_connect($host,$login,$passwd);
if (!$cnx) {
print "Error Connecting to MySQL server\n<BR>";
exit(0);
}
else {
mysql_select_db($dbase) or die("Error changing Database"
print "Connected to database!\n<BR>";
}
@mysql_select_db($dbase) or die( "Unable to select database"
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
$query="SELECT * FROM contacts";
$result=mysql_query($query);
mysql_close();
?>
<?
$host="**********";
$dbase="********";
$login="********";
$passwd="********";
$cnx = mysql_connect($host,$login,$passwd);
if (!$cnx) {
print "Error Connecting to MySQL server\n<BR>";
exit(0);
}
else {
mysql_select_db($dbase) or die("Error changing Database"
print "Connected to database!\n<BR>";
}
@mysql_select_db($dbase) or die( "Unable to select database"
$query="CREATE TABLE contacts (id int(6) NOT NULL auto_increment,first varchar(15) NOT NULL,last varchar(15) NOT NULL,phone varchar(20) NOT NULL,mobile varchar(20) NOT NULL,fax varchar(20) NOT NULL,email varchar(30) NOT NULL,web varchar(30) NOT NULL,PRIMARY KEY (id),UNIQUE id (id),KEY id_2 (id))";
mysql_query($query);
$query="SELECT * FROM contacts";
$result=mysql_query($query);
mysql_close();
?>