----- Original Message ----- 
From: "Arne Stone"

Hallo all,

Sorry for the n00b question!

I am busy learning PHP and from the eBook I copied this code:

<?php
// open connection to MySQL server
$connection = mysql_connect('localhost', 'MyUsername', 'MyPassword');
// print status message
if ($connection)
{
echo 'Connected!';
}
else
{
echo 'Could not connect!';
}
?>

When I open this in my browser I just see a blank screen not one of the
echo's shows....What could be the problem?

Thanks in advance.

---------------------------------

Hello Arne Stone,
Have a look at the source of the page in your 
browser - View Source

If you see the raw coding then your server is not parsing the file as
php. 
Is the server file extension php? and is the server set up to parse .php

files as php?

Also, this syntax is unusual, it is the same as I use ie -

normal syntax format -

if(condition){
//code ;
}

this syntax format -
if(condition)
{
// code ;
}

I thought I was one a very few that do this as it comes from PASCAL
which 
was a very long time ago.

Where did you get this coding syntax from??

Thanks. 

 

Hi 

Thanks for your reply,

 

I got this from a book called "How to Do Everything with PHP and MySQL -
McGraw Hill ".

 

I am sure the server is setup to parse .php files as php. I have been
using other .php files that work just fine.

I'll have a look at the if condition as you recommended and let you know
if it sorted the problem.

 

Thanks

.

 
<snip long footer removed by moderator>

Reply via email to