RE: Questions from a Newbie

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

 



> -----Original Message-----
> From: Ethan Rosenberg [mailto:ethros@xxxxxxxxxxxxx]
> Sent: Tuesday, October 19, 2010 9:19 AM
> To: Tommy Pham; php-general@xxxxxxxxxxxxx
> Subject: RE:  Questions from a Newbie
> 
> Dear List -
> 
> The error log only exists if he configures it properly and the script has
error.
> IE: log_errors & error_log.
> 
> I already had done that prior to the post.  That came from the manual, the
> necessary section thereof which had been read.
> 
> Now what?
> 
> Ethan
> ++++++++++++++
<snip>

Here's what I perceive your scenario to be:

1) Connect to DB:  success? If not, why not? Server problem? Network problem
if everything is not on the same box? Firewall issue? Account privilege?
2) Send query to DB: success?  If not, why not? Same questions as above...
Did something happened after a successful connection?
3) What do I do with the success of the query?  Check if it's as expected?
Store it somewhere for later use? Display the results in html/xml?

To achieve the above, you need to understand the fundamentals such as what a
variable is and the types of variables.  What control structures are
(conditions, loops, etc.)...  Did you read the all that I've mentioned?
Since you've mentioned reading the MySQL/MySQLi section was too much for you
to comprehend implies, to me, that you don't understand the fundamentals or
didn't read the sections from the official manual that are required to begin
working with PHP.

Here's the code from OP:

> /*
>  *  Create Database test22
>  */
>  <html><body>
> <?php
> $cxn = mysqli_connect("$host",$user,$password);

See point 1 for above.

> echo    "Create database test22;"

See point 2.  What's the difference between display it as text/html/xml and
assigning it to use? If to use, you need to understand the fundamentals of
SQL for the below statement, which is beyond the scope of this list.  What
database are you executing the below command for?  You wouldn't know that
unless you check the result.

> 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
> );"
>

See point 2. The below statement is the same as statement above in the
process.

> 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)
> );"
>

See point 2.

>        $sql= "SHOW DATABASES";

See point 2 & 3 for the above.

> ?>
> </body></html>

Regards,
Tommy


-- 
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