RE: [PHP] Questions from a Newbie

From: Date: Sun, 17 Oct 2010 05:41:20 +0000
Subject: RE: [PHP] Questions from a Newbie
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-308757@lists.php.net to get a copy of this message
> -----Original Message----- > From: Ethan Rosenberg [mailto:ethros@earthlink.net] > Sent: Saturday, October 16, 2010 10:01 PM > To: php-general@lists.php.net > Subject: [PHP] Questions from a Newbie > > Dear List - > > Here are some questions, which I am sure are trivial, but I am a newbie, and > cannot find the answers online.... > > I cannot get the following to work. In my Firefox [Iceweasel] browser, I > enter the following URL: [w/ the http] > > localhost/CreateNew.php All I get is a blank browser screen. > > The code contained in the file CreateNew.php is: > > /* > * Create Database test22 > */ > <html><body> > <?php > $cxn = mysqli_connect("$host",$user,$password); > echo "Create database test22;" > echo "Create table Names2 > ( > RecordNum Int(11) Primary Key Not null default=10000 auto_increment, > FirstName varchar(10), > LastName varchar(10), > Height decimal(4,1), > Weight0 decimal(4,1), > BMI decimal(3,1) > Date0 date > );" > > echo" Create table Visit2 > ( > Indx Int(7) Primary Key Not null auto_increment, > Weight decimal(4,1) not null, > StudyDate date not null, > RecordNum Int(11) > );" > > $sql= "SHOW DATABASES"; > ?> > </body></html> > > If I search for test22 or Visit2, nothing is found. > > I would also like to be able to add data to a table, using PHP, which I can do > in MySQL as: > load data infile '/home/ethan/Databases/tester21.dat.' replace into table > Names fields escaped by '\\' terminated by '\t' lines terminated by > '\n' ; > > Thanks in advance. > > Ethan > ======= > Using Debian(sid) > You're reinventing the wheel that's been rolling along very smoothly for a long time... Google 'phpmyadmin'. Also, read this entire section [1]. Regards, Tommy [1] http://www.php.net/manual/en/book.mysqli.php

« previous php.general (#308757) next »