Re: [PHP] Questions from a Newbie

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linux can be run as a GUI, using a window manager.

Aside from that, have a look at the manual pages on php.net, which give some good examples of how to use the various mysql functions.

Also, on your development machine, its a good idea to turn on errors, as it can indicate where these problems are. You can do this from the php.ini, look for display_errors.

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Ethan Rosenberg" <ethros@xxxxxxxxxxxxx>
Date: Sun, Oct 17, 2010 19:22
Subject: [PHP] Questions from a Newbie
To: "Tommy Pham" <tommyhp2@xxxxxxxxx>, <php-general@xxxxxxxxxxxxx>



At 01:41 AM 10/17/2010, Tommy Pham wrote:
> > -----Original Message-----
> > From: Ethan Rosenberg [mailto:ethros@xxxxxxxxxxxxx]
> > Sent: Saturday, October 16, 2010 10:01 PM
> > To: php-general@xxxxxxxxxxxxx
> > 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

Tommy -

Thanks.

As I stated, I am a newbie.

1] I am trying to shorten the learning curve by asking some 
questions, which I understand are probably trivial.  A whole MySQLi 
list of functions at this point is to much for me.  I have to break 
the problem into manageable parts.

2] It has been my experience that using a GUI does not teach the 
whole subject.  Linux, which is the OS I use cannot be run from a GUI.

In the code being discussed, I wish to create a database and add two 
tables.  I also note a MySQL statement that can be used to add data 
to an existing table, and wish to be able to execute this statement 
using PHP.

So, therefore......

Let us try to answer the following two(2) questions:

a] What changes [other than moving the simicolons] have to be made to 
correct the code.

b] What books can you suggest to help w/ MySQL and PHP?  I already 
have the SQL, MySQL & PHP, and HTML books in the ..... for Dummies 
series.  I need something with a little more depth and detail.

Thanks to all for your excellent help.

Ethan
========
  Using Debian(sid)
++++++++ 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux