<p dir="ltr">Take a look at the online php documentation there are loads on examples on there to get you started.</p>
<p dir="ltr">I'd also ditch the book as it's old and find some up to date tutorials online.</p>
<div class="gmail_quote">On Jul 28, 2012 9:38 AM, "Michael E. Rentell" <<a href="mailto:michael.rentell@ntlworld.com">michael.rentell@ntlworld.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<font face="sans-serif">Thanks to all who responded to my php
queries last week. All were useful.<br>
I have begun working through "PHP & MySQL for DUMMIES" but I
am having problems with the sample scripts in the book which is
dated 2004 and assumes the reader is using php 5.0.<br>
However, as I've just started with Ubuntu I find that my php is
5.5.24.<br>
It now occurs to me that perhaps there are serious differences. Is
it possible ver 5.5 is not backwards compatible with php 5.0?<br>
That would explain the problems. The sample scripts offered by
KLUG member all seem to work, but the book scripts don't.<br>
Still baffled - but learning slowly.<br>
MikeR<br>
<br>
</font>
<div>On 23/07/12 11:45, Karl Buckland wrote:<br>
</div>
<blockquote type="cite">
<pre>Hi Mike,
I'm guessing that you are getting an error, but errors are not being
displayed. They're probably being logged to Apache's error log.
To view the errors in your browser you can use the following PHP code:
--
ini_set('display_errors', 1);
error_reporting(E_ALL);
--
Hopefully if you add those line sat the top of the file, you should
see an error.
Regards,
Karl B
On 23 July 2012 11:42, Michael E. Rentell <a href="mailto:michael.rentell@ntlworld.com" target="_blank"><michael.rentell@ntlworld.com></a> wrote:
</pre>
<blockquote type="cite">
<pre>Good morning all,
As a part of my plan to limit the atrophying of my ageing brain I am working
through 'PHP & MySQL for Dummies'. I think I have got apache installed OK
because when I point firefox at localhost I get the 'It's working' response.
So I then composed the following script, called it test.php and stored it in
/var/www:
-----------------------------
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<p>
<?php
echo "This is a PHP line";
phpinfo();
?>
</body></html>
----------------------------
When I point firefox at it I get a huge table of dozens of properties which
baffle me. But it seems to indicate that php is also working.
The next step in the book is to generate a mysql db so from the CLI I went
through generating mydb, user mick and a simple password. However, there is
no data in this DB.
Then to test that I composed the following script, called it test2.php and
added it to /var/www:
--------------------------
<?php
$host = "localhost";
$user = "mick";
$pass = "simplepassword";
$r = mysql_connect($host, $user, $pass);
if (!$r) {
echo "Could not connect to server\n";
trigger_error(mysql_error(), E_USER_ERROR);
} else {
echo "Connection established\n";
}
echo mysql_get_server_info() . "\n";
mysql_close();
?>
----------------------------
When I point firefox at localhost/test2 I get a completely clear screen. It
neither seems to work or return the error. It is supposed to return a
different table of parameters etc.
Am I doing something stupid here/ If anyone can help an aged beginner I
would be most grateful. I've been banging my head against this for several
days and the book isn't any help as it expects the text to 'just work' and
it don't.
MikeR
in Folkestone
_______________________________________________
Kent mailing list
<a href="mailto:Kent@mailman.lug.org.uk" target="_blank">Kent@mailman.lug.org.uk</a>
<a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a>
</pre>
</blockquote>
<pre>.
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
Kent mailing list<br>
<a href="mailto:Kent@mailman.lug.org.uk">Kent@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/mailman/listinfo/kent</a><br></blockquote></div>