Re: parse-error MySQL - PhP @ win2000
| From: | Roel Mulder | Date: | Sat, 10 Nov 2001 21:39:02 +0000 |
| Subject: | Re: parse-error MySQL - PhP @ win2000 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-14218@lists.php.net to get a copy of this message | ||
Dag Jelle,
Als je printf(); gebruikt moet je dit wel correct doen, met print(); zou het goed moeten gaan.
Dus regel 24 wordt: print ($resultaat[0]);
(Excuse me muttering Dutch between the two of us :)
M.vr.gr.
Roel Mulder
At 21:32 10-11-2001 +0100, you wrote:
Hi all,
I have recently installed an apache server, PhP4 and MySql on my win2000 machine (I know, I should be running linux; That will have to come with time). But now I am trying to learn PhP - MySQL. When running the script below I get the error message:
Parse error: parse error in c:\phpdev\www\public\test2.php on line 25
Is there anybody who knows what the problem might be? I think is in the result display part, considering how things run properly when I leave it out. Hopefully you ca get me going, since I do not know what I am doing wrong!!
Thanks for the help,
Jelle
<?
$host="localhost";
$username="";
$password="";
$database="jelle_test";
$table="pet";
$db = mysql_connect($host)
or die ("verbinding maken met de server is mislukt");
Echo "gefeliciteerd, de verbinding is tot stand gebracht, de handle is $db";
@mysql_select_db($database, $db)
or die ("Helaas geen verbinding kunnen maken met de database");
$sql_select = "Select * from pet";
$result = mysql_query($sql_select, $db);
if($result) {
echo "Selectie succesvol";
while ( $resultaat = mysql_fetch_row($result)) {
printf($resultaat[0]);
}
mysql_close($db);
?>
--
******************
Ir. Jelle G. Ferwerda
Jelle@bio-vision.nl - www.bio-vision.nl
Mulder Technisch Advies
Postbus 69
NL-2740 AB WADDINXVEEN
tel. 0182-640184 fax. 0182-640185
http://www.mta.nl